@@ -820,14 +820,12 @@ - (UITextField*)getSearchTextField:(UISearchBar*)searchBar {
820820
821821- (void)setGridListButtonImage:(BOOL)isGridView {
822822 NSString *imgName = isGridView ? @"st_view_grid" : @"st_view_list";
823- UIImage *image = [Utilities colorizeImage:[UIImage imageNamed:imgName] withColor:ICON_TINT_COLOR];
824- [button6 setBackgroundImage:image forState:UIControlStateNormal];
823+ [button6 setDatabaseToolbarStyle:[UIImage imageNamed:imgName]];
825824}
826825
827826- (void)setSortButtonImage:(NSString*)sortOrder {
828827 NSString *imgName = [sortOrder isEqualToString:@"descending"] ? @"st_sort_desc" : @"st_sort_asc";
829- UIImage *image = [Utilities colorizeImage:[UIImage imageNamed:imgName] withColor:ICON_TINT_COLOR];
830- [button7 setBackgroundImage:image forState:UIControlStateNormal];
828+ [button7 setDatabaseToolbarStyle:[UIImage imageNamed:imgName]];
831829}
832830
833831- (void)setButtonViewContent:(int)activeTab {
@@ -3014,7 +3012,6 @@ - (void)layoutSectionView:(UIView*)albumDetailView thumbView:(UIImageView*)thumb
30143012
30153013 // Add Info button to bottom-right corner
30163014 albumInfoButton.alpha = 0.8;
3017- albumInfoButton.showsTouchWhenHighlighted = YES;
30183015 albumInfoButton.frame = CGRectMake(albumDetailView.bounds.size.width - INFO_BUTTON_SIZE,
30193016 albumDetailView.bounds.size.height - INFO_BUTTON_SIZE - TINY_PADDING,
30203017 INFO_BUTTON_SIZE,
@@ -3827,9 +3824,7 @@ - (void)toggleFullscreen {
38273824 animations:^{
38283825 collectionView.alpha = 1;
38293826 dataList.alpha = 1;
3830- UIImage *buttonImage = [UIImage imageNamed:@"button_fullscreen"];
3831- buttonImage = [Utilities colorizeImage:buttonImage withColor:ICON_TINT_COLOR];
3832- [fullscreenButton setImage:buttonImage forState:UIControlStateNormal];
3827+ [fullscreenButton setIconStyle:[UIImage imageNamed:@"button_fullscreen"]];
38333828 fullscreenButton.backgroundColor = UIColor.clearColor;
38343829 }
38353830 completion:^(BOOL finished) {
@@ -3893,9 +3888,7 @@ - (void)toggleFullscreen {
38933888 options:UIViewAnimationOptionCurveEaseInOut
38943889 animations:^{
38953890 collectionView.alpha = 1;
3896- UIImage *buttonImage = [UIImage imageNamed:@"button_exit_fullscreen"];
3897- buttonImage = [Utilities colorizeImage:buttonImage withColor:ICON_TINT_COLOR];
3898- [fullscreenButton setImage:buttonImage forState:UIControlStateNormal];
3891+ [fullscreenButton setIconStyle:[UIImage imageNamed:@"button_exit_fullscreen"]];
38993892 fullscreenButton.backgroundColor = INFO_POPOVER_COLOR;
39003893 }
39013894 completion:^(BOOL finished) {
@@ -5440,22 +5433,14 @@ - (void)buildButtons:(int)activeTab {
54405433 mainMenu *menuItem = self.detailItem;
54415434 NSArray *buttons = menuItem.mainButtons;
54425435 NSArray *buttonsIB = @[button1, button2, button3, button4, button5];
5443- UIImage *imageOff = nil;
5444- UIImage *imageOn = nil;
5445- UIImage *img = nil;
54465436 CGRect frame;
54475437 NSInteger count = buttons.count;
54485438 // If >6 buttons are required, only use 4 normal buttons and keep 5th for "more items"
54495439 if (count > MAX_NORMAL_BUTTONS + 1) {
54505440 count = MAX_NORMAL_BUTTONS;
54515441 }
54525442 for (int i = 0; i < count; i++) {
5453- img = [UIImage imageNamed:buttons[i]];
5454- imageOff = [Utilities colorizeImage:img withColor:ICON_TINT_COLOR];
5455- imageOn = [Utilities colorizeImage:img withColor:ICON_TINT_COLOR_ACTIVE];
5456- [buttonsIB[i] setBackgroundImage:imageOff forState:UIControlStateNormal];
5457- [buttonsIB[i] setBackgroundImage:imageOn forState:UIControlStateSelected];
5458- [buttonsIB[i] setBackgroundImage:imageOn forState:UIControlStateHighlighted];
5443+ [buttonsIB[i] setDatabaseToolbarStyle:[UIImage imageNamed:buttons[i]]];
54595444 [buttonsIB[i] setEnabled:YES];
54605445 }
54615446 activeTab = MIN(activeTab, MAX_NORMAL_BUTTONS);
@@ -5485,12 +5470,7 @@ - (void)buildButtons:(int)activeTab {
54855470 break;
54865471 default:
54875472 // 6 or more buttons/actions require a "more" button
5488- img = [UIImage imageNamed:@"st_more"];
5489- imageOff = [Utilities colorizeImage:img withColor:ICON_TINT_COLOR];
5490- imageOn = [Utilities colorizeImage:img withColor:ICON_TINT_COLOR_ACTIVE];
5491- [buttonsIB.lastObject setBackgroundImage:imageOff forState:UIControlStateNormal];
5492- [buttonsIB.lastObject setBackgroundImage:imageOn forState:UIControlStateSelected];
5493- [buttonsIB.lastObject setBackgroundImage:imageOn forState:UIControlStateHighlighted];
5473+ [buttonsIB.lastObject setDatabaseToolbarStyle:[UIImage imageNamed:@"st_more"]];
54945474 [buttonsIB.lastObject setEnabled:YES];
54955475 break;
54965476 }
@@ -6071,12 +6051,9 @@ - (void)checkFullscreenButton:(BOOL)forceHide {
60716051 if (fullscreenButton == nil) {
60726052 fullscreenButton = [UIButton buttonWithType:UIButtonTypeCustom];
60736053 fullscreenButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
6074- fullscreenButton.showsTouchWhenHighlighted = YES;
60756054 fullscreenButton.frame = CGRectMake(0, 0, FULLSCREEN_BUTTON_SIZE, FULLSCREEN_BUTTON_SIZE);
60766055 fullscreenButton.contentMode = UIViewContentModeCenter;
6077- UIImage *buttonImage = [UIImage imageNamed:@"button_fullscreen"];
6078- buttonImage = [Utilities colorizeImage:buttonImage withColor:ICON_TINT_COLOR];
6079- [fullscreenButton setImage:buttonImage forState:UIControlStateNormal];
6056+ [fullscreenButton setIconStyle:[UIImage imageNamed:@"button_fullscreen"]];
60806057 fullscreenButton.layer.cornerRadius = 2;
60816058 [fullscreenButton addTarget:self action:@selector(toggleFullscreen) forControlEvents:UIControlEventTouchUpInside];
60826059 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