@@ -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,
@@ -3821,9 +3818,7 @@ - (void)toggleFullscreen {
38213818 animations: ^{
38223819 collectionView.alpha = 1 ;
38233820 dataList.alpha = 1 ;
3824- UIImage *buttonImage = [UIImage imageNamed: @" button_fullscreen" ];
3825- buttonImage = [Utilities colorizeImage: buttonImage withColor: ICON_TINT_COLOR];
3826- [fullscreenButton setImage: buttonImage forState: UIControlStateNormal];
3821+ [fullscreenButton setIconStyle: [UIImage imageNamed: @" button_fullscreen" ]];
38273822 fullscreenButton.backgroundColor = UIColor.clearColor ;
38283823 }
38293824 completion: ^(BOOL finished) {
@@ -3887,9 +3882,7 @@ - (void)toggleFullscreen {
38873882 options: UIViewAnimationOptionCurveEaseInOut
38883883 animations: ^{
38893884 collectionView.alpha = 1 ;
3890- UIImage *buttonImage = [UIImage imageNamed: @" button_exit_fullscreen" ];
3891- buttonImage = [Utilities colorizeImage: buttonImage withColor: ICON_TINT_COLOR];
3892- [fullscreenButton setImage: buttonImage forState: UIControlStateNormal];
3885+ [fullscreenButton setIconStyle: [UIImage imageNamed: @" button_exit_fullscreen" ]];
38933886 fullscreenButton.backgroundColor = INFO_POPOVER_COLOR;
38943887 }
38953888 completion: ^(BOOL finished) {
@@ -5434,22 +5427,14 @@ - (void)buildButtons:(int)activeTab {
54345427 mainMenu *menuItem = self.detailItem ;
54355428 NSArray *buttons = menuItem.mainButtons ;
54365429 NSArray *buttonsIB = @[button1, button2, button3, button4, button5];
5437- UIImage *imageOff = nil ;
5438- UIImage *imageOn = nil ;
5439- UIImage *img = nil ;
54405430 CGRect frame;
54415431 NSInteger count = buttons.count ;
54425432 // If >6 buttons are required, only use 4 normal buttons and keep 5th for "more items"
54435433 if (count > MAX_NORMAL_BUTTONS + 1 ) {
54445434 count = MAX_NORMAL_BUTTONS;
54455435 }
54465436 for (int i = 0 ; i < count; i++) {
5447- img = [UIImage imageNamed: buttons[i]];
5448- imageOff = [Utilities colorizeImage: img withColor: ICON_TINT_COLOR];
5449- imageOn = [Utilities colorizeImage: img withColor: ICON_TINT_COLOR_ACTIVE];
5450- [buttonsIB[i] setBackgroundImage: imageOff forState: UIControlStateNormal];
5451- [buttonsIB[i] setBackgroundImage: imageOn forState: UIControlStateSelected];
5452- [buttonsIB[i] setBackgroundImage: imageOn forState: UIControlStateHighlighted];
5437+ [buttonsIB[i] setDatabaseToolbarStyle: [UIImage imageNamed: buttons[i]]];
54535438 [buttonsIB[i] setEnabled: YES ];
54545439 }
54555440 activeTab = MIN (activeTab, MAX_NORMAL_BUTTONS);
@@ -5479,12 +5464,7 @@ - (void)buildButtons:(int)activeTab {
54795464 break ;
54805465 default :
54815466 // 6 or more buttons/actions require a "more" button
5482- img = [UIImage imageNamed: @" st_more" ];
5483- imageOff = [Utilities colorizeImage: img withColor: ICON_TINT_COLOR];
5484- imageOn = [Utilities colorizeImage: img withColor: ICON_TINT_COLOR_ACTIVE];
5485- [buttonsIB.lastObject setBackgroundImage: imageOff forState: UIControlStateNormal];
5486- [buttonsIB.lastObject setBackgroundImage: imageOn forState: UIControlStateSelected];
5487- [buttonsIB.lastObject setBackgroundImage: imageOn forState: UIControlStateHighlighted];
5467+ [buttonsIB.lastObject setDatabaseToolbarStyle: [UIImage imageNamed: @" st_more" ]];
54885468 [buttonsIB.lastObject setEnabled: YES ];
54895469 break ;
54905470 }
@@ -6068,12 +6048,9 @@ - (void)checkFullscreenButton:(BOOL)forceHide {
60686048 if (fullscreenButton == nil ) {
60696049 fullscreenButton = [UIButton buttonWithType: UIButtonTypeCustom];
60706050 fullscreenButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
6071- fullscreenButton.showsTouchWhenHighlighted = YES ;
60726051 fullscreenButton.frame = CGRectMake (0 , 0 , FULLSCREEN_BUTTON_SIZE, FULLSCREEN_BUTTON_SIZE);
60736052 fullscreenButton.contentMode = UIViewContentModeCenter;
6074- UIImage *buttonImage = [UIImage imageNamed: @" button_fullscreen" ];
6075- buttonImage = [Utilities colorizeImage: buttonImage withColor: ICON_TINT_COLOR];
6076- [fullscreenButton setImage: buttonImage forState: UIControlStateNormal];
6053+ [fullscreenButton setIconStyle: [UIImage imageNamed: @" button_fullscreen" ]];
60776054 fullscreenButton.layer .cornerRadius = 2 ;
60786055 [fullscreenButton addTarget: self action: @selector (toggleFullscreen ) forControlEvents: UIControlEventTouchUpInside];
60796056 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