Skip to content
1 change: 1 addition & 0 deletions XBMC Remote/ConvenienceMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/
#define APP_TINT_COLOR [Utilities getGrayColor:0 alpha:0.3]
#define ICON_TINT_COLOR UIColor.lightGrayColor
#define ICON_TINT_COLOR_DARK UIColor.darkGrayColor
#define ICON_TINT_COLOR_ACTIVE UIColor.systemBlueColor
#define REMOTE_CONTROL_BAR_TINT_COLOR [Utilities getGrayColor:12 alpha:1]
#define SLIDER_DEFAULT_COLOR UIColor.lightGrayColor
Expand Down
11 changes: 6 additions & 5 deletions XBMC Remote/CustomButtonCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#define CUSTOM_BUTTON_ITEM_SPACING 4.0
#define CUSTOM_BUTTON_LABEL_PADDING 4.0
#define CUSTOM_BUTTON_BACKGROUND_INSET 2.0
#define ICON_ALPHA 0.8 // Reduce alpha to soften appearance next to button name
#define ICON_ALPHA_DISABLED 0.5 // Align with alpha of disabled UISwitch

@implementation CustomButtonCell

Expand All @@ -34,7 +36,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString*)reuse
onoff.frame = frame;
onoff.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
onoff.hidden = YES;
onoff.alpha = 0.9;
onoff.alpha = ICON_ALPHA;
[self.contentView addSubview:onoff];
self.onoffSwitch = onoff;

Expand All @@ -46,7 +48,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString*)reuse
iconSize,
iconSize);
icon.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
icon.alpha = 0.8;
icon.alpha = ICON_ALPHA;
[self.contentView addSubview:icon];
self.buttonIcon = icon;

Expand All @@ -63,7 +65,6 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString*)reuse
title.adjustsFontSizeToFitWidth = YES;
title.minimumScaleFactor = FONT_SCALING_MIN;
title.textColor = UIColor.lightGrayColor;
title.highlightedTextColor = UIColor.grayColor;
[self.contentView addSubview:title];
self.buttonLabel = title;

Expand All @@ -82,11 +83,11 @@ - (void)setEditing:(BOOL)editing animated:(BOOL)animated {
[super setEditing:editing animated:animated];
if (editing) {
self.onoffSwitch.enabled = NO;
self.buttonIcon.alpha = 0.5;
self.buttonIcon.alpha = ICON_ALPHA_DISABLED;
}
else {
self.onoffSwitch.enabled = YES;
self.buttonIcon.alpha = 0.8;
self.buttonIcon.alpha = ICON_ALPHA;
}
}

Expand Down
35 changes: 8 additions & 27 deletions XBMC Remote/DetailViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -820,14 +820,12 @@ - (UITextField*)getSearchTextField:(UISearchBar*)searchBar {

- (void)setGridListButtonImage:(BOOL)isGridView {
NSString *imgName = isGridView ? @"st_view_grid" : @"st_view_list";
UIImage *image = [Utilities colorizeImage:[UIImage imageNamed:imgName] withColor:ICON_TINT_COLOR];
[button6 setBackgroundImage:image forState:UIControlStateNormal];
[button6 setDatabaseToolbarStyle:[UIImage imageNamed:imgName]];
}

- (void)setSortButtonImage:(NSString*)sortOrder {
NSString *imgName = [sortOrder isEqualToString:@"descending"] ? @"st_sort_desc" : @"st_sort_asc";
UIImage *image = [Utilities colorizeImage:[UIImage imageNamed:imgName] withColor:ICON_TINT_COLOR];
[button7 setBackgroundImage:image forState:UIControlStateNormal];
[button7 setDatabaseToolbarStyle:[UIImage imageNamed:imgName]];
}

- (void)setButtonViewContent:(int)activeTab {
Expand Down Expand Up @@ -3014,7 +3012,6 @@ - (void)layoutSectionView:(UIView*)albumDetailView thumbView:(UIImageView*)thumb

// Add Info button to bottom-right corner
albumInfoButton.alpha = 0.8;
albumInfoButton.showsTouchWhenHighlighted = YES;
albumInfoButton.frame = CGRectMake(albumDetailView.bounds.size.width - INFO_BUTTON_SIZE,
albumDetailView.bounds.size.height - INFO_BUTTON_SIZE - TINY_PADDING,
INFO_BUTTON_SIZE,
Expand Down Expand Up @@ -3827,7 +3824,7 @@ - (void)toggleFullscreen {
animations:^{
collectionView.alpha = 1;
dataList.alpha = 1;
[fullscreenButton setImage:[UIImage imageNamed:@"button_fullscreen"] forState:UIControlStateNormal];
[fullscreenButton setIconStyle:[UIImage imageNamed:@"button_fullscreen"]];
fullscreenButton.backgroundColor = UIColor.clearColor;
}
completion:^(BOOL finished) {
Expand Down Expand Up @@ -3891,8 +3888,8 @@ - (void)toggleFullscreen {
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
collectionView.alpha = 1;
[fullscreenButton setImage:[UIImage imageNamed:@"button_exit_fullscreen"] forState:UIControlStateNormal];
fullscreenButton.backgroundColor = [Utilities getGrayColor:0 alpha:0.5];
[fullscreenButton setIconStyle:[UIImage imageNamed:@"button_exit_fullscreen"]];
fullscreenButton.backgroundColor = INFO_POPOVER_COLOR;
}
completion:^(BOOL finished) {
[activityIndicatorView stopAnimating];
Expand Down Expand Up @@ -5436,22 +5433,14 @@ - (void)buildButtons:(int)activeTab {
mainMenu *menuItem = self.detailItem;
NSArray *buttons = menuItem.mainButtons;
NSArray *buttonsIB = @[button1, button2, button3, button4, button5];
UIImage *imageOff = nil;
UIImage *imageOn = nil;
UIImage *img = nil;
CGRect frame;
NSInteger count = buttons.count;
// If >6 buttons are required, only use 4 normal buttons and keep 5th for "more items"
if (count > MAX_NORMAL_BUTTONS + 1) {
count = MAX_NORMAL_BUTTONS;
}
for (int i = 0; i < count; i++) {
img = [UIImage imageNamed:buttons[i]];
imageOff = [Utilities colorizeImage:img withColor:ICON_TINT_COLOR];
imageOn = [Utilities colorizeImage:img withColor:ICON_TINT_COLOR_ACTIVE];
[buttonsIB[i] setBackgroundImage:imageOff forState:UIControlStateNormal];
[buttonsIB[i] setBackgroundImage:imageOn forState:UIControlStateSelected];
[buttonsIB[i] setBackgroundImage:imageOn forState:UIControlStateHighlighted];
[buttonsIB[i] setDatabaseToolbarStyle:[UIImage imageNamed:buttons[i]]];
[buttonsIB[i] setEnabled:YES];
}
activeTab = MIN(activeTab, MAX_NORMAL_BUTTONS);
Expand Down Expand Up @@ -5481,12 +5470,7 @@ - (void)buildButtons:(int)activeTab {
break;
default:
// 6 or more buttons/actions require a "more" button
img = [UIImage imageNamed:@"st_more"];
imageOff = [Utilities colorizeImage:img withColor:ICON_TINT_COLOR];
imageOn = [Utilities colorizeImage:img withColor:ICON_TINT_COLOR_ACTIVE];
[buttonsIB.lastObject setBackgroundImage:imageOff forState:UIControlStateNormal];
[buttonsIB.lastObject setBackgroundImage:imageOn forState:UIControlStateSelected];
[buttonsIB.lastObject setBackgroundImage:imageOn forState:UIControlStateHighlighted];
[buttonsIB.lastObject setDatabaseToolbarStyle:[UIImage imageNamed:@"st_more"]];
[buttonsIB.lastObject setEnabled:YES];
break;
}
Expand Down Expand Up @@ -6067,13 +6051,10 @@ - (void)checkFullscreenButton:(BOOL)forceHide {
if (fullscreenButton == nil) {
fullscreenButton = [UIButton buttonWithType:UIButtonTypeCustom];
fullscreenButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
fullscreenButton.showsTouchWhenHighlighted = YES;
fullscreenButton.frame = CGRectMake(0, 0, FULLSCREEN_BUTTON_SIZE, FULLSCREEN_BUTTON_SIZE);
fullscreenButton.contentMode = UIViewContentModeCenter;
[fullscreenButton setImage:[UIImage imageNamed:@"button_fullscreen"] forState:UIControlStateNormal];
[fullscreenButton setIconStyle:[UIImage imageNamed:@"button_fullscreen"]];
fullscreenButton.layer.cornerRadius = 2;
fullscreenButton.tintColor = UIColor.whiteColor;
fullscreenButton.alpha = 0.9;
[fullscreenButton addTarget:self action:@selector(toggleFullscreen) forControlEvents:UIControlEventTouchUpInside];
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);
[titleView addSubview:fullscreenButton];
Expand Down
14 changes: 7 additions & 7 deletions XBMC Remote/DetailViewController.xib
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<items>
<barButtonItem style="plain" systemItem="flexibleSpace" id="OQd-aJ-obl"/>
<barButtonItem style="plain" id="yuj-lW-yot">
<button key="customView" hidden="YES" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" id="117" userLabel="Button1">
<button key="customView" hidden="YES" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="117" userLabel="Button1">
<rect key="frame" x="10.5" y="7" width="34" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
Expand All @@ -102,7 +102,7 @@
</barButtonItem>
<barButtonItem style="plain" systemItem="flexibleSpace" id="IVe-28-sl6"/>
<barButtonItem style="plain" id="cRW-wf-x2D">
<button key="customView" hidden="YES" tag="1" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" id="119" userLabel="Button2">
<button key="customView" hidden="YES" tag="1" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="119" userLabel="Button2">
<rect key="frame" x="54.5" y="7" width="34" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
Expand All @@ -120,7 +120,7 @@
</barButtonItem>
<barButtonItem style="plain" systemItem="flexibleSpace" id="dSm-ED-j5s"/>
<barButtonItem style="plain" id="4He-Lr-2WZ">
<button key="customView" hidden="YES" tag="2" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" id="121" userLabel="Button3">
<button key="customView" hidden="YES" tag="2" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="121" userLabel="Button3">
<rect key="frame" x="99" y="7" width="34" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
Expand All @@ -138,7 +138,7 @@
</barButtonItem>
<barButtonItem style="plain" systemItem="flexibleSpace" id="Gi1-6Y-y4k"/>
<barButtonItem style="plain" id="TE7-pJ-4WE">
<button key="customView" hidden="YES" tag="3" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" id="122" userLabel="Button4">
<button key="customView" hidden="YES" tag="3" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="122" userLabel="Button4">
<rect key="frame" x="143" y="7" width="34" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
Expand All @@ -156,7 +156,7 @@
</barButtonItem>
<barButtonItem style="plain" systemItem="flexibleSpace" id="ZdQ-hl-bWG"/>
<barButtonItem style="plain" id="d4P-SH-Im4">
<button key="customView" hidden="YES" tag="4" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" id="123" userLabel="Button5">
<button key="customView" hidden="YES" tag="4" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="123" userLabel="Button5">
<rect key="frame" x="187.5" y="7" width="34" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
Expand All @@ -174,15 +174,15 @@
</barButtonItem>
<barButtonItem style="plain" systemItem="flexibleSpace" id="C79-Cc-JFa"/>
<barButtonItem style="plain" id="rHQ-LZ-GMb">
<button key="customView" hidden="YES" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" id="kky-5P-ej6" userLabel="Button6">
<button key="customView" hidden="YES" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="kky-5P-ej6" userLabel="Button6">
<rect key="frame" x="231.5" y="5" width="34" height="34"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" backgroundImage="st_view_list"/>
</button>
</barButtonItem>
<barButtonItem style="plain" systemItem="flexibleSpace" id="bQB-y4-wNs"/>
<barButtonItem style="plain" id="WWo-3h-QTx">
<button key="customView" hidden="YES" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" id="17m-9l-ySa" userLabel="Button7">
<button key="customView" hidden="YES" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="17m-9l-ySa" userLabel="Button7">
<rect key="frame" x="276" y="5" width="34" height="34"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" backgroundImage="st_sort_asc"/>
Expand Down
12 changes: 3 additions & 9 deletions XBMC Remote/HostManagementViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -546,19 +546,15 @@ - (void)viewDidLoad {
supportedVersionLabel.text = LOCALIZED_STR(@"Supported XBMC version is Eden (11) or higher");

editTableButton.titleLabel.font = [UIFont systemFontOfSize:15];
[editTableButton setTitleColor:UIColor.grayColor forState:UIControlStateDisabled];
[editTableButton setTitleColor:UIColor.grayColor forState:UIControlStateHighlighted];
[editTableButton setTitleColor:UIColor.whiteColor forState:UIControlStateSelected];
[editTableButton setTextStyle];
editTableButton.titleLabel.shadowOffset = CGSizeZero;

addHostButton.titleLabel.font = [UIFont systemFontOfSize:15];
[addHostButton setTitleColor:UIColor.grayColor forState:UIControlStateHighlighted];
[addHostButton setTitleColor:UIColor.whiteColor forState:UIControlStateSelected];
[addHostButton setTextStyle];
addHostButton.titleLabel.shadowOffset = CGSizeZero;

serverInfoButton.titleLabel.font = [UIFont systemFontOfSize:15];
[serverInfoButton setTitleColor:UIColor.grayColor forState:UIControlStateHighlighted];
[serverInfoButton setTitleColor:UIColor.whiteColor forState:UIControlStateSelected];
[serverInfoButton setTextStyle];
serverInfoButton.titleLabel.shadowOffset = CGSizeZero;

serverListTableView.indicatorStyle = UIScrollViewIndicatorStyleWhite;
Expand All @@ -581,8 +577,6 @@ - (void)viewDidLoad {
UIImage *image = [UIImage imageNamed:@"kodi_logo_wide"];
UIButton *xbmcLogo = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, image.size.width, image.size.height)];
[xbmcLogo setImage:image forState:UIControlStateNormal];
[xbmcLogo setImage:image forState:UIControlStateHighlighted];
xbmcLogo.showsTouchWhenHighlighted = NO;
[xbmcLogo addTarget:self action:@selector(infoView) forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.titleView = xbmcLogo;
UIImage *menuImg = [UIImage imageNamed:@"button_menu"];
Expand Down
4 changes: 2 additions & 2 deletions XBMC Remote/MasterViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ - (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSI
title.numberOfLines = 1;
title.text = item.mainLabel;
icon.highlightedImage = [UIImage imageNamed:iconName];
icon.image = [Utilities colorizeImage:icon.highlightedImage withColor:UIColor.grayColor];
icon.image = [Utilities colorizeImage:icon.highlightedImage withColor:ICON_TINT_COLOR];
cell.backgroundColor = UIColor.clearColor;
}
return cell;
Expand Down Expand Up @@ -210,7 +210,7 @@ - (void)addConnectionStatusToRootView {

- (void)setConnectionIcon:(UIImageView*)icon {
// Load icon for top row in main menu
UIColor *iconColor = AppDelegate.instance.serverOnLine ? KODI_BLUE_COLOR : UIColor.grayColor;
UIColor *iconColor = AppDelegate.instance.serverOnLine ? KODI_BLUE_COLOR : ICON_TINT_COLOR;
UIImage *image = [Utilities colorizeImage:[UIImage imageNamed:@"st_kodi_action"] withColor:iconColor];
icon.highlightedImage = image;
icon.image = image;
Expand Down
Loading