Commit 1405cf74 authored by Felix Paul Kühne's avatar Felix Paul Kühne

Redesigned the window to make it look more Mac-like and much smaller by adding...

Redesigned the window to make it look more Mac-like and much smaller by adding a popupbutton at the top to choose the filters and by removing all the expanding stuff

This way adding more uis to different filters is much easier and faster to do.
parent 87232707
......@@ -91,22 +91,41 @@
{
CLASS = IBInspector;
LANGUAGE = ObjC;
OUTLETS = {inspectorView = NSView; };
OUTLETS = {
inspectorView = NSView;
};
SUPERCLASS = NSObject;
},
{
CLASS = IBLibraryObjectTemplate;
LANGUAGE = ObjC;
OUTLETS = {draggedView = NSView; representedObject = NSObject; };
OUTLETS = {
draggedView = NSView;
representedObject = NSObject;
};
SUPERCLASS = NSView;
},
{CLASS = NSDateFormatter; LANGUAGE = ObjC; SUPERCLASS = NSFormatter; },
{CLASS = NSFormatter; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = NSNumberFormatter; LANGUAGE = ObjC; SUPERCLASS = NSFormatter; },
{
CLASS = NSDateFormatter;
LANGUAGE = ObjC;
SUPERCLASS = NSFormatter;
},
{
CLASS = NSFormatter;
LANGUAGE = ObjC;
SUPERCLASS = NSObject;
},
{
CLASS = NSNumberFormatter;
LANGUAGE = ObjC;
SUPERCLASS = NSFormatter;
},
{
CLASS = PDFThumbnailView;
LANGUAGE = ObjC;
OUTLETS = {pdfView = PDFView; };
OUTLETS = {
pdfView = PDFView;
};
SUPERCLASS = NSView;
},
{
......@@ -131,24 +150,19 @@
enableAdjustImage = id;
enableHeadphoneVirtualizer = id;
enableVolumeNormalization = id;
expandAdjustImage = id;
expandAudioFilters = id;
expandVideoFilters = id;
moreInfoVideoFilters = id;
opaqueSliderAction = id;
restoreDefaultsForAdjustImage = id;
sliderActionAdjustImage = id;
sliderActionMaximumAudioLevel = id;
videoFilterAction = id;
viewSelectorAction = id;
};
CLASS = VLCExtended;
LANGUAGE = ObjC;
OUTLETS = {
"o_adjustImg_view" = id;
"o_audioFlts_view" = id;
"o_box_adjImg" = id;
"o_box_audFlts" = id;
"o_box_vidFlts" = id;
"o_btn_rstrDefaults" = id;
"o_btn_vidFlts_mrInfo" = id;
"o_ckb_blur" = id;
......@@ -164,13 +178,7 @@
"o_ckb_trnsform" = id;
"o_ckb_vlme_norm" = id;
"o_ckb_wave" = id;
"o_expBtn_adjustImage" = id;
"o_expBtn_audioFlts" = id;
"o_expBtn_videoFlts" = id;
"o_extended_window" = id;
"o_lbl_adjustImage" = id;
"o_lbl_audio" = id;
"o_lbl_audioFlts" = id;
"o_lbl_brightness" = id;
"o_lbl_contrast" = id;
"o_lbl_distort" = id;
......@@ -180,8 +188,7 @@
"o_lbl_maxLevel" = id;
"o_lbl_opaque" = id;
"o_lbl_saturation" = id;
"o_lbl_video" = id;
"o_lbl_videoFlts" = id;
"o_selector_pop" = id;
"o_sld_brightness" = id;
"o_sld_contrast" = id;
"o_sld_gamma" = id;
......@@ -189,6 +196,7 @@
"o_sld_maxLevel" = id;
"o_sld_opaque" = id;
"o_sld_saturation" = id;
"o_top_controls_box" = id;
"o_videoFilters_view" = id;
};
SUPERCLASS = NSObject;
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>69 85 356 240 0 0 1440 878 </string>
<string>59 108 356 240 0 0 1280 778 </string>
<key>IBEditorPositions</key>
<dict>
<key>13</key>
<string>153 575 390 138 0 0 1440 878 </string>
<string>444 613 390 120 0 0 1280 778 </string>
<key>32</key>
<string>525 476 390 255 0 0 1440 878 </string>
<string>445 426 390 237 0 0 1280 778 </string>
<key>5</key>
<string>518 235 390 230 0 0 1440 878 </string>
<string>57 437 390 214 0 0 1280 778 </string>
</dict>
<key>IBFramework Version</key>
<string>446.1</string>
<string>489.0</string>
<key>IBOpenObjects</key>
<array>
<integer>13</integer>
<integer>5</integer>
<integer>18</integer>
<integer>32</integer>
<integer>13</integer>
</array>
<key>IBSystem Version</key>
<string>8P135</string>
<string>9D34</string>
<key>targetFramework</key>
<string>IBCocoaFramework</string>
</dict>
......
......@@ -38,17 +38,8 @@
IBOutlet id o_extended_window;
/* window content */
IBOutlet id o_expBtn_adjustImage;
IBOutlet id o_expBtn_audioFlts;
IBOutlet id o_expBtn_videoFlts;
IBOutlet id o_lbl_audioFlts;
IBOutlet id o_lbl_videoFlts;
IBOutlet id o_lbl_adjustImage;
IBOutlet id o_lbl_video;
IBOutlet id o_lbl_audio;
IBOutlet id o_box_vidFlts;
IBOutlet id o_box_audFlts;
IBOutlet id o_box_adjImg;
IBOutlet id o_selector_pop;
IBOutlet id o_top_controls_box;
/* video filters */
IBOutlet id o_btn_vidFlts_mrInfo;
......@@ -88,13 +79,11 @@
IBOutlet id o_sld_opaque;
/* global variables */
BOOL o_adjImg_expanded;
BOOL o_audFlts_expanded;
BOOL o_vidFlts_expanded;
NSView * o_currentlyshown_view;
BOOL o_config_changed;
}
- (IBAction)viewSelectorAction:(id)sender;
- (IBAction)enableAdjustImage:(id)sender;
- (IBAction)restoreDefaultsForAdjustImage:(id)sender;
- (IBAction)sliderActionAdjustImage:(id)sender;
......@@ -102,15 +91,11 @@
- (IBAction)enableHeadphoneVirtualizer:(id)sender;
- (IBAction)sliderActionMaximumAudioLevel:(id)sender;
- (IBAction)enableVolumeNormalization:(id)sender;
- (IBAction)expandAdjustImage:(id)sender;
- (IBAction)expandAudioFilters:(id)sender;
- (IBAction)expandVideoFilters:(id)sender;
- (IBAction)videoFilterAction:(id)sender;
- (IBAction)moreInfoVideoFilters:(id)sender;
+ (VLCExtended *)sharedInstance;
- (BOOL)getConfigChanged;
- (void)collapsAll;
- (void)showPanel;
- (void)initStrings;
......
......@@ -65,11 +65,6 @@ static VLCExtended *_o_sharedInstance = nil;
/* localise GUI-strings */
/* method is called from intf.m (in method showExtended) */
[o_extended_window setTitle: _NS("Extended controls")];
[o_lbl_video setStringValue: _NS("Video")];
[o_lbl_audio setStringValue: _NS("Audio")];
[o_lbl_audioFlts setStringValue: _NS("Audio filters")];
[o_lbl_videoFlts setStringValue: _NS("Video filters")];
[o_lbl_adjustImage setStringValue: _NS("Image adjustment")];
[o_btn_vidFlts_mrInfo setToolTip: _NS("Shows more information about the available video filters.")];
[o_ckb_wave setTitle: _NS("Wave")];
[o_ckb_ripple setTitle: _NS("Ripple")];
......@@ -170,19 +165,18 @@ static VLCExtended *_o_sharedInstance = nil;
free( psz_afilters );
}
}
- (void)collapsAll
{
/* collaps all views so Cocoa saves the window position correctly */
if( o_adjImg_expanded )
[self expandAdjustImage: nil];
/* fill the popup button according to our available views */
[o_selector_pop removeAllItems];
[o_selector_pop addItemWithTitle: _NS("Adjust Image")];
[o_selector_pop addItemWithTitle: _NS("Video Filter")];
[o_selector_pop addItemWithTitle: _NS("Audio Filter")];
[o_selector_pop selectItemAtIndex: 0];
if( o_audFlts_expanded )
[self expandAudioFilters: nil];
/* make sure we draw a view on launch */
[self viewSelectorAction: self];
if( o_vidFlts_expanded )
[self expandVideoFilters: nil];
[self initStrings];
}
- (BOOL)getConfigChanged
......@@ -232,6 +226,53 @@ static VLCExtended *_o_sharedInstance = nil;
[o_extended_window makeKeyAndOrderFront:nil];
}
- (IBAction)viewSelectorAction:(id)sender
{
NSView *o_toBeShown_view;
/* check which view to show */
if( [[[o_selector_pop selectedItem] title] isEqualToString: _NS("Adjust Image")] )
o_toBeShown_view = o_adjustImg_view;
else if( [[[o_selector_pop selectedItem] title] isEqualToString: _NS("Audio Filter")] )
o_toBeShown_view = o_audioFlts_view;
else if( [[[o_selector_pop selectedItem] title] isEqualToString: _NS("Video Filter")] )
o_toBeShown_view = o_videoFilters_view;
else
msg_Err( VLCIntf, "invalid ui view requested" );
NSRect o_win_rect, o_view_rect, o_old_view_rect;
o_win_rect = [o_extended_window frame];
o_view_rect = [o_toBeShown_view frame];
if( o_currentlyshown_view != nil )
{
/* restore our window's height, if we've shown another category previously */
o_old_view_rect = [o_currentlyshown_view frame];
o_win_rect.size.height = o_win_rect.size.height - o_old_view_rect.size.height;
o_win_rect.origin.y = ( o_win_rect.origin.y + o_old_view_rect.size.height ) - o_view_rect.size.height;
/* remove our previous category view */
[o_currentlyshown_view removeFromSuperviewWithoutNeedingDisplay];
}
o_win_rect.size.height = o_win_rect.size.height + o_view_rect.size.height;
//[o_extended_window displayIfNeeded];
[o_extended_window setFrame: o_win_rect display:YES animate: YES];
[o_toBeShown_view setFrame: NSMakeRect( 0,
0, //[o_top_controls_box frame].size.height,
o_view_rect.size.width,
o_view_rect.size.height )];
[o_toBeShown_view setNeedsDisplay: YES];
[o_toBeShown_view setAutoresizesSubviews: YES];
[[o_extended_window contentView] addSubview: o_toBeShown_view];
/* keep our current category for further reference */
[o_currentlyshown_view release];
o_currentlyshown_view = o_toBeShown_view;
[o_currentlyshown_view retain];
}
- (IBAction)enableAdjustImage:(id)sender
{
/* en-/disable the sliders */
......@@ -433,150 +474,6 @@ static VLCExtended *_o_sharedInstance = nil;
[self changeAFiltersString: "normvol" onOrOff: NO ];
}
- (IBAction)expandAdjustImage:(id)sender
{
/* expand or collapse adjImg */
NSRect o_win_rect = [o_extended_window frame];
NSRect o_box_audFlts_rect = [o_box_audFlts frame];
NSRect o_box_vidFlts_rect = [o_box_vidFlts frame];
NSRect o_box_adjImg_rect = [o_box_adjImg frame];
if( o_adjImg_expanded )
{
/* move the window contents upwards (partially done through settings
* inside the nib) and resize the window */
o_win_rect.size.height = o_win_rect.size.height - 193;
o_win_rect.origin.y = [o_extended_window frame].origin.y + 193;
o_box_audFlts_rect.origin.y = o_box_audFlts_rect.origin.y + 193;
o_box_vidFlts_rect.origin.y = o_box_vidFlts_rect.origin.y + 193;
/* remove the inserted view */
[o_adjustImg_view removeFromSuperviewWithoutNeedingDisplay];
}
else
{
/* move the window contents downwards and resize the window */
o_win_rect.size.height = o_win_rect.size.height + 193;
o_win_rect.origin.y = [o_extended_window frame].origin.y - 193;
o_box_audFlts_rect.origin.y = o_box_audFlts_rect.origin.y - 193;
o_box_vidFlts_rect.origin.y = o_box_vidFlts_rect.origin.y - 193;
}
[o_box_audFlts setFrameFromContentFrame: o_box_audFlts_rect];
[o_box_vidFlts setFrameFromContentFrame: o_box_vidFlts_rect];
[o_extended_window displayIfNeeded];
[o_extended_window setFrame: o_win_rect display:YES animate: YES];
if( o_adjImg_expanded )
{
o_box_adjImg_rect.size.height = [o_box_adjImg frame].size.height - 193;
o_adjImg_expanded = NO;
}
else
{
/* insert view */
o_box_adjImg_rect.size.height = [o_box_adjImg frame].size.height + 193;
[o_adjustImg_view setFrame: NSMakeRect( 20, -10, 370, 203)];
[o_adjustImg_view setNeedsDisplay:YES];
[o_adjustImg_view setAutoresizesSubviews: YES];
[[o_box_adjImg contentView] addSubview: o_adjustImg_view];
o_adjImg_expanded = YES;
}
[o_box_adjImg setFrameFromContentFrame: o_box_adjImg_rect];
}
- (IBAction)expandAudioFilters:(id)sender
{
/* expand or collapse audFlts */
NSRect o_win_rect = [o_extended_window frame];
NSRect o_box_audFlts_rect = [o_box_audFlts frame];
if( o_audFlts_expanded )
{
/* move the window contents upwards (partially done through settings
* inside the nib) and resize the window */
o_win_rect.size.height = o_win_rect.size.height - 66;
o_win_rect.origin.y = [o_extended_window frame].origin.y + 66;
/* remove the inserted view */
[o_audioFlts_view removeFromSuperviewWithoutNeedingDisplay];
}
else
{
/* move the window contents downwards and resize the window */
o_win_rect.size.height = o_win_rect.size.height + 66;
o_win_rect.origin.y = [o_extended_window frame].origin.y - 66;
}
[o_extended_window displayIfNeeded];
[o_extended_window setFrame: o_win_rect display:YES animate: YES];
if( o_audFlts_expanded )
{
o_box_audFlts_rect.size.height = [o_box_audFlts frame].size.height - 66;
o_audFlts_expanded = NO;
}
else
{
/* insert view */
o_box_audFlts_rect.size.height = [o_box_audFlts frame].size.height + 66;
[o_audioFlts_view setFrame: NSMakeRect( 20, -20, 370, 76)];
[o_audioFlts_view setNeedsDisplay:YES];
[o_audioFlts_view setAutoresizesSubviews: YES];
[[o_box_audFlts contentView] addSubview: o_audioFlts_view];
o_audFlts_expanded = YES;
}
[o_box_audFlts setFrameFromContentFrame: o_box_audFlts_rect];
}
- (IBAction)expandVideoFilters:(id)sender
{
/* expand or collapse vidFlts */
NSRect o_win_rect = [o_extended_window frame];
NSRect o_box_audFlts_rect = [o_box_audFlts frame];
NSRect o_box_vidFlts_rect = [o_box_vidFlts frame];
if( o_vidFlts_expanded )
{
/* move the window contents upwards (partially done through settings
* inside the nib) and resize the window */
o_win_rect.size.height = o_win_rect.size.height - 172;
o_win_rect.origin.y = [o_extended_window frame].origin.y + 172;
o_box_audFlts_rect.origin.y = o_box_audFlts_rect.origin.y + 172;
/* remove the inserted view */
[o_videoFilters_view removeFromSuperviewWithoutNeedingDisplay];
}
else
{
/* move the window contents downwards and resize the window */
o_win_rect.size.height = o_win_rect.size.height + 172;
o_win_rect.origin.y = [o_extended_window frame].origin.y - 172;
o_box_audFlts_rect.origin.y = o_box_audFlts_rect.origin.y - 172;
}
[o_box_audFlts setFrameFromContentFrame: o_box_audFlts_rect];
[o_extended_window displayIfNeeded];
[o_extended_window setFrame: o_win_rect display:YES animate: YES];
if( o_vidFlts_expanded )
{
o_box_vidFlts_rect.size.height = [o_box_vidFlts frame].size.height - 172;
o_vidFlts_expanded = NO;
}
else
{
/* insert view */
o_box_vidFlts_rect.size.height = [o_box_vidFlts frame].size.height + 172;
[o_videoFilters_view setFrame: NSMakeRect( 20, -10, 370, 172)];
[o_videoFilters_view setNeedsDisplay:YES];
[o_videoFilters_view setAutoresizesSubviews: YES];
[[o_box_vidFlts contentView] addSubview: o_videoFilters_view];
o_vidFlts_expanded = YES;
}
[o_box_vidFlts setFrameFromContentFrame: o_box_vidFlts_rect];
}
- (IBAction)videoFilterAction:(id)sender
{
/* en-/disable video filters */
......
......@@ -1817,7 +1817,6 @@ static VLCMain *_o_sharedMainInstance = nil;
if( nib_extended_loaded )
{
[o_extended collapsAll];
[o_extended release];
}
......@@ -1944,17 +1943,12 @@ static VLCMain *_o_sharedMainInstance = nil;
- (IBAction)showExtended:(id)sender
{
if( o_extended == nil )
{
o_extended = [[VLCExtended alloc] init];
}
if( !nib_extended_loaded )
{
nib_extended_loaded = [NSBundle loadNibNamed:@"Extended" owner:self];
[o_extended initStrings];
[o_extended showPanel];
} else {
[o_extended showPanel];
}
}
- (IBAction)showSFilters:(id)sender
......
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