]> git.sesse.net Git - vlc/commitdiff
macosx: hide the MRL field by default and shrink it. You can make it appear by clicki...
authorFelix Paul Kühne <fkuehne@videolan.org>
Tue, 3 Mar 2009 14:04:54 +0000 (15:04 +0100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Tue, 3 Mar 2009 14:05:58 +0000 (15:05 +0100)
extras/package/macosx/Resources/English.lproj/Open.nib/classes.nib
extras/package/macosx/Resources/English.lproj/Open.nib/info.nib
extras/package/macosx/Resources/English.lproj/Open.nib/keyedobjects.nib
modules/gui/macosx/open.h
modules/gui/macosx/open.m

index 2f1f4e15a12f93d026dab24530f8d73f0a6390ab..268cf582a96474d1484d60c3a91c49035f9f8f8f 100644 (file)
@@ -16,6 +16,7 @@
         },
                 {
             ACTIONS =             {
+                expandMRLfieldAction = id;
                 eyetvGetPlugin = id;
                 eyetvLaunch = id;
                 eyetvSwitchChannel = id;
                 "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;
index 13867766def9d101a9d4bd85b9bac8e248dbd9a6..488a41e2314096aea9b776ed5d316ded2cdadc8d 100644 (file)
@@ -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>
        <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>
index b466a0b6c5e9e9aa6b3e58dd964691d07e5464cc..805e8acb60b2f37893c98f373c60a30ecdb8d573 100644 (file)
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
index b0b0546d24fe217410464802897dc869b7ad13e7..7c17507e6d2cc8161af80d4c50135514993dea40 100644 (file)
@@ -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;
index 174c0b4b8c3e64ac33f7345f74d2c01625faf4bd..0333993256fc8135def4709fca03eae427e9c4cd 100644 (file)
@@ -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];