[vlc-devel] commit: macosx: hide the MRL field by default and shrink it. You can make it appear by clicking on the triangle button next to the MRL label . ( Felix Paul Kühne )

git version control git at videolan.org
Tue Mar 3 15:05:59 CET 2009


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Tue Mar  3 15:04:54 2009 +0100| [f8a3fb1aff4e62efc620db8e7e9acfab81e1f31f] | committer: Felix Paul Kühne 

macosx: hide the MRL field by default and shrink it. You can make it appear by clicking on the triangle button next to the MRL label.

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

 .../Resources/English.lproj/Open.nib/classes.nib   |    3 ++
 .../Resources/English.lproj/Open.nib/info.nib      |    7 +++-
 .../English.lproj/Open.nib/keyedobjects.nib        |  Bin 91069 -> 92226 bytes
 modules/gui/macosx/open.h                          |    3 ++
 modules/gui/macosx/open.m                          |   34 +++++++++++++++++++-
 5 files changed, 44 insertions(+), 3 deletions(-)

diff --git a/extras/package/macosx/Resources/English.lproj/Open.nib/classes.nib b/extras/package/macosx/Resources/English.lproj/Open.nib/classes.nib
index 2f1f4e1..268cf58 100644
--- a/extras/package/macosx/Resources/English.lproj/Open.nib/classes.nib
+++ b/extras/package/macosx/Resources/English.lproj/Open.nib/classes.nib
@@ -16,6 +16,7 @@
         },
                 {
             ACTIONS =             {
+                expandMRLfieldAction = id;
                 eyetvGetPlugin = id;
                 eyetvLaunch = id;
                 eyetvSwitchChannel = id;
@@ -103,7 +104,9 @@
                 "o_file_sub_size_lbl" = id;
                 "o_file_sub_size_pop" = id;
                 "o_mrl" = id;
+                "o_mrl_btn" = id;
                 "o_mrl_lbl" = id;
+                "o_mrl_view" = id;
                 "o_net_help_lbl" = id;
                 "o_net_help_udp_lbl" = id;
                 "o_net_http_url" = id;
diff --git a/extras/package/macosx/Resources/English.lproj/Open.nib/info.nib b/extras/package/macosx/Resources/English.lproj/Open.nib/info.nib
index 1386776..488a41e 100644
--- a/extras/package/macosx/Resources/English.lproj/Open.nib/info.nib
+++ b/extras/package/macosx/Resources/English.lproj/Open.nib/info.nib
@@ -3,13 +3,15 @@
 <plist version="1.0">
 <dict>
 	<key>IBDocumentLocation</key>
-	<string>97 169 356 240 0 0 1280 778 </string>
+	<string>63 88 356 240 0 0 1280 778 </string>
 	<key>IBEditorPositions</key>
 	<dict>
 		<key>2297</key>
 		<string>366 401 548 264 0 0 1280 778 </string>
 		<key>2346</key>
 		<string>366 401 548 264 0 0 1280 778 </string>
+		<key>2837</key>
+		<string>353 532 573 94 0 0 1280 778 </string>
 	</dict>
 	<key>IBFramework Version</key>
 	<string>489.0</string>
@@ -17,10 +19,11 @@
 	<integer>5</integer>
 	<key>IBOpenObjects</key>
 	<array>
+		<integer>2792</integer>
 		<integer>2346</integer>
 		<integer>636</integer>
-		<integer>2792</integer>
 		<integer>2297</integer>
+		<integer>2837</integer>
 	</array>
 	<key>IBSystem Version</key>
 	<string>9G55</string>
diff --git a/extras/package/macosx/Resources/English.lproj/Open.nib/keyedobjects.nib b/extras/package/macosx/Resources/English.lproj/Open.nib/keyedobjects.nib
index b466a0b..805e8ac 100644
Binary files a/extras/package/macosx/Resources/English.lproj/Open.nib/keyedobjects.nib and b/extras/package/macosx/Resources/English.lproj/Open.nib/keyedobjects.nib differ
diff --git a/modules/gui/macosx/open.h b/modules/gui/macosx/open.h
index b0b0546..7c17507 100644
--- a/modules/gui/macosx/open.h
+++ b/modules/gui/macosx/open.h
@@ -37,6 +37,8 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class );
 
     IBOutlet id o_mrl;
     IBOutlet id o_mrl_lbl;
+    IBOutlet id o_mrl_view;
+    IBOutlet id o_mrl_btn;
     IBOutlet id o_tabview;
 
     IBOutlet id o_btn_ok;
@@ -158,6 +160,7 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class );
 - (void)openTarget:(int)i_type;
 - (void)tabView:(NSTabView *)o_tv didSelectTabViewItem:(NSTabViewItem *)o_tvi;
 - (void)textFieldWasClicked:(NSNotification *)o_notification;
+- (IBAction)expandMRLfieldAction:(id)sender;
 
 - (void)openFileGeneric;
 - (void)openFilePathChanged:(NSNotification *)o_notification;
diff --git a/modules/gui/macosx/open.m b/modules/gui/macosx/open.m
index 174c0b4..0333993 100644
--- a/modules/gui/macosx/open.m
+++ b/modules/gui/macosx/open.m
@@ -161,7 +161,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
 - (void)awakeFromNib
 {
     [o_panel setTitle: _NS("Open Source")];
-    [o_mrl_lbl setTitle: _NS("Media Resource Locator (MRL)")];
+    [o_mrl_lbl setStringValue: _NS("Media Resource Locator (MRL)")];
 
     [o_btn_ok setTitle: _NS("Open")];
     [o_btn_cancel setTitle: _NS("Cancel")];
@@ -448,6 +448,38 @@ static VLCOpen *_o_sharedMainInstance = nil;
     }
 }
 
+- (IBAction)expandMRLfieldAction:(id)sender
+{
+    NSRect o_win_rect, o_view_rect;
+    o_win_rect = [o_panel frame];
+    o_view_rect = [o_mrl_view frame];
+
+    if( [o_mrl_btn state] == NSOffState )
+    {
+        /* we need to collaps, restore the panel size */
+        o_win_rect.size.height = o_win_rect.size.height - o_view_rect.size.height;
+        o_win_rect.origin.y = ( o_win_rect.origin.y + o_view_rect.size.height ) - o_view_rect.size.height;
+
+        /* remove the MRL view */
+        [o_mrl_view removeFromSuperviewWithoutNeedingDisplay];
+    } else {
+        /* we need to expand */
+        [o_mrl_view setFrame: NSMakeRect( 0,
+                                         [o_mrl_btn frame].origin.y,
+                                         o_view_rect.size.width,
+                                         o_view_rect.size.height )];
+        [o_mrl_view setNeedsDisplay: YES];
+        [o_mrl_view setAutoresizesSubviews: YES];
+
+        /* add the MRL view */
+        [[o_panel contentView] addSubview: o_mrl_view];
+        o_win_rect.size.height = o_win_rect.size.height + o_view_rect.size.height;
+    }
+
+    [o_panel setFrame: o_win_rect display:YES animate: YES];
+    [o_panel displayIfNeeded];
+}
+
 - (void)openFileGeneric
 {
     [self openFilePathChanged: nil];




More information about the vlc-devel mailing list