2121#import " RemoteController.h"
2222
2323#define CONNECTION_TIMEOUT 240.0
24- #define VIEW_PADDING 10 /* separation between toolbar views */
24+ #define INFO_PADDING 10
25+ #define BUTTON_PADDING 5
2526#define TOOLBAR_HEIGHT 44
26- #define XBMCLOGO_WIDTH 30
27+ #define XBMCLOGO_WIDTH 42
2728#define POWERBUTTON_WIDTH 42
29+ #define SETTINGSBUTTON_WIDTH 42
2830#define REMOTE_ICON_SIZE 30
2931#define CONNECTION_ICON_SIZE 18
30- #define CONNECTION_PADDING 20
32+ #define CONNECTION_PADDING 10
3133#define REMOTE_PADDING 15
3234#define DESKTOP_PADDING 25
3335#define PLAYLIST_HEADER_HEIGHT 24
@@ -97,7 +99,7 @@ - (void)changeServerStatus:(BOOL)status infoText:(NSString*)infoText icon:(NSStr
9799 }
98100 }
99101 [xbmcInfo setTitle: infoText forState: UIControlStateNormal];
100- [Utilities setStyleOfMenuItems: menuViewController.tableView active: status];
102+ [Utilities setStyleOfMenuItems: menuViewController.tableView active: status menu: mainMenu ];
101103}
102104
103105- (void )offStackView {
@@ -397,7 +399,7 @@ - (void)viewDidLoad {
397399 [self .view addSubview: showDesktopButton];
398400
399401 // right most element
400- connectionStatus = [[UIImageView alloc ] initWithFrame: CGRectMake (self .view.frame.size.width - CONNECTION_ICON_SIZE - VIEW_PADDING , self .view.frame.size.height - (TOOLBAR_HEIGHT + CONNECTION_ICON_SIZE) / 2 - [Utilities getBottomPadding ], CONNECTION_ICON_SIZE, CONNECTION_ICON_SIZE)];
402+ connectionStatus = [[UIImageView alloc ] initWithFrame: CGRectMake (self .view.frame.size.width - CONNECTION_ICON_SIZE - CONNECTION_PADDING , self .view.frame.size.height - (TOOLBAR_HEIGHT + CONNECTION_ICON_SIZE) / 2 - [Utilities getBottomPadding ], CONNECTION_ICON_SIZE, CONNECTION_ICON_SIZE)];
401403 connectionStatus.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin;
402404 [self .view addSubview: connectionStatus];
403405
@@ -413,17 +415,27 @@ - (void)viewDidLoad {
413415 [self .view addSubview: xbmcLogo];
414416
415417 // 3rd right most element
418+ image = [UIImage imageNamed: @" icon_menu_settings" ];
419+ image = [Utilities colorizeImage: image withColor: UIColor.lightGrayColor];
420+ settingsButton = [[UIButton alloc ] initWithFrame: CGRectMake (xbmcLogo.frame.origin.x - SETTINGSBUTTON_WIDTH - BUTTON_PADDING, self .view.frame.size.height - TOOLBAR_HEIGHT, SETTINGSBUTTON_WIDTH, TOOLBAR_HEIGHT)];
421+ [settingsButton setImage: image forState: UIControlStateNormal];
422+ [settingsButton setImage: image forState: UIControlStateHighlighted];
423+ settingsButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin;
424+ [settingsButton addTarget: self action: @selector (enterAppSettings ) forControlEvents: UIControlEventTouchUpInside];
425+ [self .view addSubview: settingsButton];
426+
427+ // 4th right most element
416428 image = [UIImage imageNamed: @" icon_power" ];
417429 image = [Utilities colorizeImage: image withColor: UIColor.lightGrayColor];
418- powerButton = [[UIButton alloc ] initWithFrame: CGRectMake (xbmcLogo .frame.origin.x - POWERBUTTON_WIDTH - VIEW_PADDING , self .view.frame.size.height - TOOLBAR_HEIGHT, POWERBUTTON_WIDTH, TOOLBAR_HEIGHT)];
430+ powerButton = [[UIButton alloc ] initWithFrame: CGRectMake (settingsButton .frame.origin.x - POWERBUTTON_WIDTH - BUTTON_PADDING , self .view.frame.size.height - TOOLBAR_HEIGHT, POWERBUTTON_WIDTH, TOOLBAR_HEIGHT)];
419431 [powerButton setImage: image forState: UIControlStateNormal];
420432 [powerButton setImage: image forState: UIControlStateHighlighted];
421433 powerButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin;
422434 [powerButton addTarget: self action: @selector (powerControl ) forControlEvents: UIControlEventTouchUpInside];
423435 [self .view addSubview: powerButton];
424436
425437 // element between left most and 2nd right most uses up free space
426- CGFloat infoPadding = self.view .frame .size .width - CGRectGetMinX (powerButton.frame ) + 2 * VIEW_PADDING ;
438+ CGFloat infoPadding = self.view .frame .size .width - CGRectGetMinX (powerButton.frame ) + 2 * INFO_PADDING ;
427439 CGFloat infoStart = PAD_MENU_TABLE_WIDTH + infoPadding;
428440 CGFloat infoWidth = self.view .frame .size .width - PAD_MENU_TABLE_WIDTH - 2 * infoPadding;
429441 xbmcInfo = [[UIButton alloc ] initWithFrame: CGRectMake (infoStart, self .view.frame.size.height - TOOLBAR_HEIGHT, infoWidth, TOOLBAR_HEIGHT)];
@@ -457,6 +469,10 @@ - (void)viewDidLoad {
457469 frame.origin .y -= bottomPadding;
458470 powerButton.frame = frame;
459471
472+ frame = settingsButton.frame ;
473+ frame.origin .y -= bottomPadding;
474+ settingsButton.frame = frame;
475+
460476 frame = xbmcInfo.frame ;
461477 frame.origin .y -= bottomPadding;
462478 xbmcInfo.frame = frame;
0 commit comments