Commit 343498be authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: simplify progress bar resizing code and fix certain re-drawing issues

parent 84e4fd26
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
IBOutlet id o_volume_track_view; IBOutlet id o_volume_track_view;
IBOutlet id o_volume_down_btn; IBOutlet id o_volume_down_btn;
IBOutlet id o_volume_up_btn; IBOutlet id o_volume_up_btn;
IBOutlet id o_progress_view;
IBOutlet id o_time_sld; IBOutlet id o_time_sld;
IBOutlet id o_time_sld_fancygradient_view; IBOutlet id o_time_sld_fancygradient_view;
IBOutlet id o_time_fld; IBOutlet id o_time_fld;
......
...@@ -396,16 +396,9 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -396,16 +396,9 @@ static VLCMainWindow *_o_sharedInstance = nil;
moveItem(o_time_fld); moveItem(o_time_fld);
#undef moveItem #undef moveItem
#define enlargeItem(item) \ frame = [o_progress_view frame];
frame = [item frame]; \ frame.size.width = f_width + frame.size.width;
frame.size.width = f_width + frame.size.width; \ [o_progress_view setFrame: frame];
[item setFrame: frame]
enlargeItem(o_time_sld);
enlargeItem(o_progress_bar);
enlargeItem(o_time_sld_background);
enlargeItem(o_time_sld_fancygradient_view);
#undef enlargeItem
[o_fullscreen_btn removeFromSuperviewWithoutNeedingDisplay]; [o_fullscreen_btn removeFromSuperviewWithoutNeedingDisplay];
} else { } else {
...@@ -705,20 +698,13 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -705,20 +698,13 @@ static VLCMainWindow *_o_sharedInstance = nil;
moveItem(o_shuffle_btn); moveItem(o_shuffle_btn);
#undef moveItem #undef moveItem
#define resizeItem(item) \ frame = [o_progress_view frame];
frame = [item frame]; \ frame.size.width = frame.size.width - f_space;
frame.size.width = frame.size.width - f_space; \ frame.origin.x = frame.origin.x + f_space;
frame.origin.x = frame.origin.x + f_space; \ if (b_fast)
if (b_fast) \ [o_progress_view setFrame: frame];
[item setFrame: frame]; \ else
else \ [[o_progress_view animator] setFrame: frame];
[[item animator] setFrame: frame]
resizeItem(o_time_sld);
resizeItem(o_progress_bar);
resizeItem(o_time_sld_background);
resizeItem(o_time_sld_fancygradient_view);
#undef resizeItem
if (b_dark_interface) { if (b_dark_interface) {
[[o_fwd_btn animator] setImage:[NSImage imageNamed:@"forward-6btns-dark"]]; [[o_fwd_btn animator] setImage:[NSImage imageNamed:@"forward-6btns-dark"]];
...@@ -797,20 +783,13 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -797,20 +783,13 @@ static VLCMainWindow *_o_sharedInstance = nil;
moveItem(o_shuffle_btn); moveItem(o_shuffle_btn);
#undef moveItem #undef moveItem
#define resizeItem(item) \ frame = [o_progress_view frame];
frame = [item frame]; \ frame.size.width = frame.size.width + f_space;
frame.size.width = frame.size.width + f_space; \ frame.origin.x = frame.origin.x - f_space;
frame.origin.x = frame.origin.x - f_space; \ if (b_fast)
if (b_fast) \ [o_progress_view setFrame: frame];
[item setFrame: frame]; \ else
else \ [[o_progress_view animator] setFrame: frame];
[[item animator] setFrame: frame]
resizeItem(o_time_sld);
resizeItem(o_progress_bar);
resizeItem(o_time_sld_background);
resizeItem(o_time_sld_fancygradient_view);
#undef resizeItem
if (b_dark_interface) { if (b_dark_interface) {
[[o_fwd_btn animator] setImage:[NSImage imageNamed:@"forward-3btns-dark"]]; [[o_fwd_btn animator] setImage:[NSImage imageNamed:@"forward-3btns-dark"]];
...@@ -864,20 +843,13 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -864,20 +843,13 @@ static VLCMainWindow *_o_sharedInstance = nil;
[[o_shuffle_btn animator] setHidden: NO]; [[o_shuffle_btn animator] setHidden: NO];
} }
#define resizeItem(item) \ frame = [o_progress_view frame];
frame = [item frame]; \ frame.size.width = frame.size.width - f_space;
frame.size.width = frame.size.width - f_space; \ frame.origin.x = frame.origin.x + f_space;
frame.origin.x = frame.origin.x + f_space; \ if (b_fast)
if (b_fast) \ [o_progress_view setFrame: frame];
[item setFrame: frame]; \ else
else \ [[o_progress_view animator] setFrame: frame];
[[item animator] setFrame: frame]
resizeItem(o_time_sld);
resizeItem(o_progress_bar);
resizeItem(o_time_sld_background);
resizeItem(o_time_sld_fancygradient_view);
#undef resizeItem
} }
- (void)removePlaymodeButtons:(BOOL)b_fast - (void)removePlaymodeButtons:(BOOL)b_fast
...@@ -898,20 +870,13 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -898,20 +870,13 @@ static VLCMainWindow *_o_sharedInstance = nil;
frame.size.width++; frame.size.width++;
[o_playlist_btn setFrame:frame]; [o_playlist_btn setFrame:frame];
#define resizeItem(item) \ frame = [o_progress_view frame];
frame = [item frame]; \ frame.size.width = frame.size.width + f_space;
frame.size.width = frame.size.width + f_space; \ frame.origin.x = frame.origin.x - f_space;
frame.origin.x = frame.origin.x - f_space; \ if (b_fast)
if (b_fast) \ [o_progress_view setFrame: frame];
[item setFrame: frame]; \ else
else \ [[o_progress_view animator] setFrame: frame];
[[item animator] setFrame: frame]
resizeItem(o_time_sld);
resizeItem(o_progress_bar);
resizeItem(o_time_sld_background);
resizeItem(o_time_sld_fancygradient_view);
#undef resizeItem
} }
#pragma mark - #pragma mark -
......
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