From: Felix Paul Kühne Date: Fri, 19 Aug 2011 15:28:32 +0000 (+0200) Subject: macosx: show the playlist size as a badge in the sidebar and fixed an appearance... X-Git-Tag: 1.2.0-pre1~1139 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=50f7ba573a98f01e2ecac6c5f8eaca351d45634c;p=vlc macosx: show the playlist size as a badge in the sidebar and fixed an appearance issue of the sidebar --- diff --git a/extras/package/macosx/Resources/English.lproj/MainMenu.xib b/extras/package/macosx/Resources/English.lproj/MainMenu.xib index f25af13507..216683964b 100644 --- a/extras/package/macosx/Resources/English.lproj/MainMenu.xib +++ b/extras/package/macosx/Resources/English.lproj/MainMenu.xib @@ -11,14 +11,14 @@ 1 - + + + - + - - com.apple.InterfaceBuilder.CocoaPlugin @@ -663,7 +663,7 @@ 4352 - {121, 272} + {120, 272} 2 YES @@ -674,7 +674,7 @@ - 118 + 117 16 1000 @@ -764,7 +764,7 @@ 14 - {{1, 1}, {121, 272}} + {{1, 1}, {120, 272}} 2 @@ -794,7 +794,7 @@ 0.9953052 - {{-1, 0}, {123, 274}} + {122, 274} 2 @@ -6947,6 +6947,14 @@ LCAuLi4 4751 + + + o_left_split_view + + + + 4752 + @@ -10232,6 +10240,9 @@ LCAuLi4 AUMMAABBoAAAA com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAAAAAAAAw4gAAA + PXSourceList com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -10312,7 +10323,7 @@ LCAuLi4 - 4751 + 4752 @@ -13441,6 +13452,7 @@ LCAuLi4 VLCFSPanel id id + id id id id @@ -13505,6 +13517,10 @@ LCAuLi4 o_fwd_btn id + + o_left_split_view + id + o_play_btn id diff --git a/modules/gui/macosx/MainWindow.h b/modules/gui/macosx/MainWindow.h index c353e23659..3e887d1bb0 100644 --- a/modules/gui/macosx/MainWindow.h +++ b/modules/gui/macosx/MainWindow.h @@ -58,6 +58,7 @@ IBOutlet id o_playlist_table; IBOutlet id o_video_view; IBOutlet id o_split_view; + IBOutlet id o_left_split_view; IBOutlet id o_right_split_view; IBOutlet id o_sidebar_view; IBOutlet id o_chosen_category_lbl; diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m index 2c2544fbb8..b449b2e147 100644 --- a/modules/gui/macosx/MainWindow.m +++ b/modules/gui/macosx/MainWindow.m @@ -235,6 +235,7 @@ static VLCMainWindow *_o_sharedInstance = nil; o_temp_view = [[NSView alloc] init]; [o_temp_view setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable]; [o_dropzone_view setFrame: [o_playlist_table frame]]; + [o_left_split_view setFrame: [o_sidebar_view frame]]; if (OSX_LION) { [self setCollectionBehavior: NSWindowCollectionBehaviorFullScreenPrimary]; @@ -755,6 +756,8 @@ static VLCMainWindow *_o_sharedInstance = nil; b_plmul = playlist_CurrentSize( p_playlist ) > 1; PL_UNLOCK; + [o_sidebar_view reloadData]; + input_thread_t * p_input = playlist_CurrentInput( p_playlist ); bool b_buffering = NO; @@ -1450,12 +1453,25 @@ static VLCMainWindow *_o_sharedInstance = nil; - (BOOL)sourceList:(PXSourceList*)aSourceList itemHasBadge:(id)item { + if ([[item identifier] isEqualToString: @"playlist"]) + return YES; + return [item hasBadge]; } - (NSInteger)sourceList:(PXSourceList*)aSourceList badgeValueForItem:(id)item { + if ([[item identifier] isEqualToString: @"playlist"]) { + playlist_t * p_playlist = pl_Get( VLCIntf ); + NSInteger i_playlist_size; + + PL_LOCK; + i_playlist_size = playlist_CurrentSize( p_playlist ); + PL_UNLOCK; + + return i_playlist_size; + } return [item badgeValue]; }