Commit d36071e0 authored by Marvin Scholz's avatar Marvin Scholz Committed by Jean-Baptiste Kempf

macosx: Improve VLCStatusBarIcon class

Use actual references to the MenuItems instead of finding them using tags.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 90d34ab6
...@@ -35,9 +35,6 @@ ...@@ -35,9 +35,6 @@
#pragma mark - #pragma mark -
#pragma mark Defines #pragma mark Defines
#define playPauseMenuItemTag 74747
#define stopMenuItemTag 83838
#define randomMenuItemTag 63636
#define dataUpdateTimerInterval 1.0 #define dataUpdateTimerInterval 1.0
#define NSInitialToolTipDelayIn_ms 20 #define NSInitialToolTipDelayIn_ms 20
// #define showURLInToolTip 1 // #define showURLInToolTip 1
...@@ -123,8 +120,7 @@ ...@@ -123,8 +120,7 @@
_menuImagePause = [NSImage imageNamed:@"pauseIcon"]; _menuImagePause = [NSImage imageNamed:@"pauseIcon"];
_menuImageStop = [NSImage imageNamed:@"stopIcon"]; _menuImageStop = [NSImage imageNamed:@"stopIcon"];
NSMenuItem *menuItemToChange = [_vlcStatusBarIconMenu itemWithTag:stopMenuItemTag]; [stopItem setImage:_menuImageStop];
[menuItemToChange setImage:_menuImageStop];
// I'd rather not use a timer and only update when mouse comes near // I'd rather not use a timer and only update when mouse comes near
// status icon in bar. But one can't tell without evil sourcery :( // status icon in bar. But one can't tell without evil sourcery :(
...@@ -314,12 +310,10 @@ ...@@ -314,12 +310,10 @@
playlist_t *p_playlist = pl_Get(getIntf()); playlist_t *p_playlist = pl_Get(getIntf());
b_value = var_GetBool(p_playlist, "random"); b_value = var_GetBool(p_playlist, "random");
// get menuitem 'Random'
NSMenuItem* menuItemToChange = [_vlcStatusBarIconMenu itemWithTag:randomMenuItemTag];
if (b_value) { if (b_value) {
[menuItemToChange setState:NSOnState]; [randItem setState:NSOnState];
} else { } else {
[menuItemToChange setState:NSOffState]; [randItem setState:NSOffState];
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment