[vlc-commits] macosx: info panel: implement window toggling

David Fuhrmann git at videolan.org
Sat Jan 2 22:36:48 CET 2016


vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sat Jan  2 22:29:10 2016 +0100| [8eb81762f0261c9c4b3757a89d77e485c4b634d5] | committer: David Fuhrmann

macosx: info panel: implement window toggling

Like all other panels.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8eb81762f0261c9c4b3757a89d77e485c4b634d5
---

 modules/gui/macosx/MainMenu.m        |    2 +-
 modules/gui/macosx/VLCPlaylist.m     |    2 +-
 modules/gui/macosx/VLCPlaylistInfo.h |    2 +-
 modules/gui/macosx/VLCPlaylistInfo.m |   11 +++++++----
 4 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/modules/gui/macosx/MainMenu.m b/modules/gui/macosx/MainMenu.m
index ae64997..03d896f 100644
--- a/modules/gui/macosx/MainMenu.m
+++ b/modules/gui/macosx/MainMenu.m
@@ -1357,7 +1357,7 @@
 
 - (IBAction)showInformationPanel:(id)sender
 {
-    [[[VLCMain sharedInstance] currentMediaInfoPanel] showPanel];
+    [[[VLCMain sharedInstance] currentMediaInfoPanel] toggleWindow:sender];
 }
 
 #pragma mark - convinience stuff for other objects
diff --git a/modules/gui/macosx/VLCPlaylist.m b/modules/gui/macosx/VLCPlaylist.m
index c0b7cc5..16d3c54 100644
--- a/modules/gui/macosx/VLCPlaylist.m
+++ b/modules/gui/macosx/VLCPlaylist.m
@@ -394,7 +394,7 @@
 
 - (IBAction)showInfoPanel:(id)sender
 {
-    [[[VLCMain sharedInstance] currentMediaInfoPanel] showPanel];
+    [[[VLCMain sharedInstance] currentMediaInfoPanel] toggleWindow:sender];
 }
 
 - (IBAction)deleteItem:(id)sender
diff --git a/modules/gui/macosx/VLCPlaylistInfo.h b/modules/gui/macosx/VLCPlaylistInfo.h
index e75eeae..3aa84e5 100644
--- a/modules/gui/macosx/VLCPlaylistInfo.h
+++ b/modules/gui/macosx/VLCPlaylistInfo.h
@@ -95,7 +95,7 @@
 @property (readwrite, weak) IBOutlet NSTextField *videoDecodedTextField;
 
 - (void)updateCocoaWindowLevel:(NSInteger)i_level;
-- (void)showPanel;
+- (IBAction)toggleWindow:(id)sender;
 
 - (IBAction)metaFieldChanged:(id)sender;
 - (IBAction)saveMetaData:(id)sender;
diff --git a/modules/gui/macosx/VLCPlaylistInfo.m b/modules/gui/macosx/VLCPlaylistInfo.m
index 39ae495..7e3f933 100644
--- a/modules/gui/macosx/VLCPlaylistInfo.m
+++ b/modules/gui/macosx/VLCPlaylistInfo.m
@@ -132,11 +132,14 @@
         [self.window setLevel: i_level];
 }
 
-- (void)showPanel
+- (IBAction)toggleWindow:(id)sender
 {
-    NSInteger i_level = [[[VLCMain sharedInstance] voutController] currentStatusWindowLevel];
-    [self.window setLevel: i_level];
-    [self.window makeKeyAndOrderFront:nil];
+    if ([self.window isKeyWindow])
+        [self.window orderOut:sender];
+    else {
+        [self.window setLevel: [[[VLCMain sharedInstance] voutController] currentStatusWindowLevel]];
+        [self.window makeKeyAndOrderFront:sender];
+    }
 }
 
 - (void)initMediaPanelStats



More information about the vlc-commits mailing list