@@ -823,14 +823,12 @@ - (UITextField*)getSearchTextField:(UISearchBar*)searchBar {
823823
824824- (void)setGridListButtonImage:(BOOL)isGridView {
825825 NSString *imgName = isGridView ? @"st_view_grid" : @"st_view_list";
826- UIImage *image = [Utilities colorizeImage:[UIImage imageNamed:imgName] withColor:ICON_TINT_COLOR];
827- [button6 setBackgroundImage:image forState:UIControlStateNormal];
826+ [button6 setDatabaseToolbarStyle:[UIImage imageNamed:imgName]];
828827}
829828
830829- (void)setSortButtonImage:(NSString*)sortOrder {
831830 NSString *imgName = [sortOrder isEqualToString:@"descending"] ? @"st_sort_desc" : @"st_sort_asc";
832- UIImage *image = [Utilities colorizeImage:[UIImage imageNamed:imgName] withColor:ICON_TINT_COLOR];
833- [button7 setBackgroundImage:image forState:UIControlStateNormal];
831+ [button7 setDatabaseToolbarStyle:[UIImage imageNamed:imgName]];
834832}
835833
836834- (void)setButtonViewContent:(int)activeTab {
@@ -3018,7 +3016,6 @@ - (void)layoutSectionView:(UIView*)albumDetailView thumbView:(UIImageView*)thumb
30183016
30193017 // Add Info button to bottom-right corner
30203018 albumInfoButton.alpha = 0.8;
3021- albumInfoButton.showsTouchWhenHighlighted = YES;
30223019 albumInfoButton.frame = CGRectMake(albumDetailView.bounds.size.width - INFO_BUTTON_SIZE,
30233020 albumDetailView.bounds.size.height - INFO_BUTTON_SIZE - TINY_PADDING,
30243021 INFO_BUTTON_SIZE,
@@ -3829,9 +3826,7 @@ - (void)toggleFullscreen {
38293826 animations:^{
38303827 collectionView.alpha = 1;
38313828 dataList.alpha = 1;
3832- UIImage *buttonImage = [UIImage imageNamed:@"button_fullscreen"];
3833- buttonImage = [Utilities colorizeImage:buttonImage withColor:ICON_TINT_COLOR];
3834- [fullscreenButton setImage:buttonImage forState:UIControlStateNormal];
3829+ [fullscreenButton setIconStyle:[UIImage imageNamed:@"button_fullscreen"]];
38353830 fullscreenButton.backgroundColor = UIColor.clearColor;
38363831 }
38373832 completion:^(BOOL finished) {
@@ -3895,9 +3890,7 @@ - (void)toggleFullscreen {
38953890 options:UIViewAnimationOptionCurveEaseInOut
38963891 animations:^{
38973892 collectionView.alpha = 1;
3898- UIImage *buttonImage = [UIImage imageNamed:@"button_exit_fullscreen"];
3899- buttonImage = [Utilities colorizeImage:buttonImage withColor:ICON_TINT_COLOR];
3900- [fullscreenButton setImage:buttonImage forState:UIControlStateNormal];
3893+ [fullscreenButton setIconStyle:[UIImage imageNamed:@"button_exit_fullscreen"]];
39013894 fullscreenButton.backgroundColor = INFO_POPOVER_COLOR;
39023895 }
39033896 completion:^(BOOL finished) {
@@ -5445,22 +5438,14 @@ - (void)buildButtons:(int)activeTab {
54455438 mainMenu *menuItem = self.detailItem;
54465439 NSArray *buttons = menuItem.mainButtons;
54475440 NSArray *buttonsIB = @[button1, button2, button3, button4, button5];
5448- UIImage *imageOff = nil;
5449- UIImage *imageOn = nil;
5450- UIImage *img = nil;
54515441 CGRect frame;
54525442 NSInteger count = buttons.count;
54535443 // If >6 buttons are required, only use 4 normal buttons and keep 5th for "more items"
54545444 if (count > MAX_NORMAL_BUTTONS + 1) {
54555445 count = MAX_NORMAL_BUTTONS;
54565446 }
54575447 for (int i = 0; i < count; i++) {
5458- img = [UIImage imageNamed:buttons[i]];
5459- imageOff = [Utilities colorizeImage:img withColor:ICON_TINT_COLOR];
5460- imageOn = [Utilities colorizeImage:img withColor:ICON_TINT_COLOR_ACTIVE];
5461- [buttonsIB[i] setBackgroundImage:imageOff forState:UIControlStateNormal];
5462- [buttonsIB[i] setBackgroundImage:imageOn forState:UIControlStateSelected];
5463- [buttonsIB[i] setBackgroundImage:imageOn forState:UIControlStateHighlighted];
5448+ [buttonsIB[i] setDatabaseToolbarStyle:[UIImage imageNamed:buttons[i]]];
54645449 [buttonsIB[i] setEnabled:YES];
54655450 }
54665451 activeTab = MIN(activeTab, MAX_NORMAL_BUTTONS);
@@ -5500,12 +5485,7 @@ - (void)buildButtons:(int)activeTab {
55005485 break;
55015486 default:
55025487 // 6 or more buttons/actions require a "more" button
5503- img = [UIImage imageNamed:@"st_more"];
5504- imageOff = [Utilities colorizeImage:img withColor:ICON_TINT_COLOR];
5505- imageOn = [Utilities colorizeImage:img withColor:ICON_TINT_COLOR_ACTIVE];
5506- [buttonsIB.lastObject setBackgroundImage:imageOff forState:UIControlStateNormal];
5507- [buttonsIB.lastObject setBackgroundImage:imageOn forState:UIControlStateSelected];
5508- [buttonsIB.lastObject setBackgroundImage:imageOn forState:UIControlStateHighlighted];
5488+ [buttonsIB.lastObject setDatabaseToolbarStyle:[UIImage imageNamed:@"st_more"]];
55095489 [buttonsIB.lastObject setEnabled:YES];
55105490 break;
55115491 }
@@ -6097,12 +6077,9 @@ - (void)checkFullscreenButton:(BOOL)forceHide {
60976077 if (fullscreenButton == nil) {
60986078 fullscreenButton = [UIButton buttonWithType:UIButtonTypeCustom];
60996079 fullscreenButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
6100- fullscreenButton.showsTouchWhenHighlighted = YES;
61016080 fullscreenButton.frame = CGRectMake(0, 0, FULLSCREEN_BUTTON_SIZE, FULLSCREEN_BUTTON_SIZE);
61026081 fullscreenButton.contentMode = UIViewContentModeCenter;
6103- UIImage *buttonImage = [UIImage imageNamed:@"button_fullscreen"];
6104- buttonImage = [Utilities colorizeImage:buttonImage withColor:ICON_TINT_COLOR];
6105- [fullscreenButton setImage:buttonImage forState:UIControlStateNormal];
6082+ [fullscreenButton setIconStyle:[UIImage imageNamed:@"button_fullscreen"]];
61066083 fullscreenButton.layer.cornerRadius = 2;
61076084 [fullscreenButton addTarget:self action:@selector(toggleFullscreen) forControlEvents:UIControlEventTouchUpInside];
61086085 fullscreenButton.frame = CGRectMake(titleView.frame.size.width - fullscreenButton.frame.size.width, titleView.frame.size.height / 2 - fullscreenButton.frame.size.height / 2, fullscreenButton.frame.size.width, fullscreenButton.frame.size.height);
0 commit comments