Commit f8a3fb1a authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: hide the MRL field by default and shrink it. You can make it appear by...

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.
parent 0b7bd6a2
......@@ -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;
......
......@@ -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>
......
......@@ -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;
......
......@@ -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];
......
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