Commit 941cff44 authored by David Fuhrmann's avatar David Fuhrmann

macosx: unify functionality of fwd/bwd buttons in video window

Behaviour is now the same as the buttons in main window

close #9512
parent 89f67375
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
@property (readonly) id bottomBarView; @property (readonly) id bottomBarView;
- (CGFloat)height; - (CGFloat)height;
- (void)toggleForwardBackwardMode:(BOOL)b_alt;
- (IBAction)play:(id)sender; - (IBAction)play:(id)sender;
- (IBAction)bwd:(id)sender; - (IBAction)bwd:(id)sender;
......
...@@ -156,6 +156,9 @@ ...@@ -156,6 +156,9 @@
[o_fullscreen_btn removeFromSuperviewWithoutNeedingDisplay]; [o_fullscreen_btn removeFromSuperviewWithoutNeedingDisplay];
} }
if (config_GetInt(VLCIntf, "macosx-show-playback-buttons"))
[self toggleForwardBackwardMode: YES];
} }
- (CGFloat)height - (CGFloat)height
...@@ -163,6 +166,26 @@ ...@@ -163,6 +166,26 @@
return [o_bottombar_view frame].size.height; return [o_bottombar_view frame].size.height;
} }
- (void)toggleForwardBackwardMode:(BOOL)b_alt
{
if (b_alt == YES) {
/* change the accessibility help for the backward/forward buttons accordingly */
[[o_bwd_btn cell] accessibilitySetOverrideValue:_NS("Click and hold to skip backward through the current media.") forAttribute:NSAccessibilityDescriptionAttribute];
[[o_fwd_btn cell] accessibilitySetOverrideValue:_NS("Click and hold to skip forward through the current media.") forAttribute:NSAccessibilityDescriptionAttribute];
[o_fwd_btn setAction:@selector(alternateForward:)];
[o_bwd_btn setAction:@selector(alternateBackward:)];
} else {
/* change the accessibility help for the backward/forward buttons accordingly */
[[o_bwd_btn cell] accessibilitySetOverrideValue:_NS("Click to go to the previous playlist item. Hold to skip backward through the current media.") forAttribute:NSAccessibilityDescriptionAttribute];
[[o_fwd_btn cell] accessibilitySetOverrideValue:_NS("Click to go to the next playlist item. Hold to skip forward through the current media.") forAttribute:NSAccessibilityDescriptionAttribute];
[o_fwd_btn setAction:@selector(fwd:)];
[o_bwd_btn setAction:@selector(bwd:)];
}
}
#pragma mark - #pragma mark -
#pragma mark Button Actions #pragma mark Button Actions
...@@ -241,6 +264,17 @@ ...@@ -241,6 +264,17 @@
} }
} }
// alternative actions for forward / backward buttons when next / prev are activated
- (IBAction)alternateForward:(id)sender
{
[[VLCCoreInteraction sharedInstance] forwardExtraShort];
}
- (IBAction)alternateBackward:(id)sender
{
[[VLCCoreInteraction sharedInstance] backwardExtraShort];
}
- (IBAction)timeSliderAction:(id)sender - (IBAction)timeSliderAction:(id)sender
{ {
float f_updated; float f_updated;
...@@ -740,10 +774,6 @@ else \ ...@@ -740,10 +774,6 @@ else \
[o_next_btn setAlternateImage: [NSImage imageNamed:@"next-6btns-pressed"]]; [o_next_btn setAlternateImage: [NSImage imageNamed:@"next-6btns-pressed"]];
} }
/* change the accessibility help for the backward/forward buttons accordingly */
[[o_bwd_btn cell] accessibilitySetOverrideValue:_NS("Click and hold to skip backward through the current media.") forAttribute:NSAccessibilityDescriptionAttribute];
[[o_fwd_btn cell] accessibilitySetOverrideValue:_NS("Click and hold to skip forward through the current media.") forAttribute:NSAccessibilityDescriptionAttribute];
NSRect frame; NSRect frame;
frame = [o_bwd_btn frame]; frame = [o_bwd_btn frame];
frame.size.width--; frame.size.width--;
...@@ -804,8 +834,7 @@ else \ ...@@ -804,8 +834,7 @@ else \
[o_bottombar_view performSelector:@selector(addSubview:) withObject:o_next_btn afterDelay:.2]; [o_bottombar_view performSelector:@selector(addSubview:) withObject:o_next_btn afterDelay:.2];
} }
[o_fwd_btn setAction:@selector(forward:)]; [self toggleForwardBackwardMode: YES];
[o_bwd_btn setAction:@selector(backward:)];
} }
- (void)removeJumpButtons:(BOOL)b_fast - (void)removeJumpButtons:(BOOL)b_fast
...@@ -827,10 +856,6 @@ else \ ...@@ -827,10 +856,6 @@ else \
[o_next_btn release]; [o_next_btn release];
o_next_btn = NULL; o_next_btn = NULL;
/* change the accessibility help for the backward/forward buttons accordingly */
[[o_bwd_btn cell] accessibilitySetOverrideValue:_NS("Click to go to the previous playlist item. Hold to skip backward through the current media.") forAttribute:NSAccessibilityDescriptionAttribute];
[[o_fwd_btn cell] accessibilitySetOverrideValue:_NS("Click to go to the next playlist item. Hold to skip forward through the current media.") forAttribute:NSAccessibilityDescriptionAttribute];
NSRect frame; NSRect frame;
frame = [o_bwd_btn frame]; frame = [o_bwd_btn frame];
frame.size.width++; frame.size.width++;
...@@ -879,10 +904,9 @@ else \ ...@@ -879,10 +904,9 @@ else \
[[o_bwd_btn animator] setAlternateImage:[NSImage imageNamed:@"backward-3btns-pressed"]]; [[o_bwd_btn animator] setAlternateImage:[NSImage imageNamed:@"backward-3btns-pressed"]];
} }
[o_bottombar_view setNeedsDisplay:YES]; [self toggleForwardBackwardMode: NO];
[o_fwd_btn setAction:@selector(fwd:)]; [o_bottombar_view setNeedsDisplay:YES];
[o_bwd_btn setAction:@selector(bwd:)];
} }
- (void)togglePlaymodeButtons - (void)togglePlaymodeButtons
...@@ -974,17 +998,6 @@ else \ ...@@ -974,17 +998,6 @@ else \
[[VLCCoreInteraction sharedInstance] next]; [[VLCCoreInteraction sharedInstance] next];
} }
// alternative actions for forward / backward buttons when next / prev are activated
- (IBAction)forward:(id)sender
{
[[VLCCoreInteraction sharedInstance] forwardExtraShort];
}
- (IBAction)backward:(id)sender
{
[[VLCCoreInteraction sharedInstance] backwardExtraShort];
}
- (void)setRepeatOne - (void)setRepeatOne
{ {
[o_repeat_btn setImage: o_repeat_one_img]; [o_repeat_btn setImage: o_repeat_one_img];
......
...@@ -707,7 +707,12 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -707,7 +707,12 @@ static VLCMainMenu *_o_sharedInstance = nil;
{ {
BOOL b_value = !config_GetInt(VLCIntf, "macosx-show-playback-buttons"); BOOL b_value = !config_GetInt(VLCIntf, "macosx-show-playback-buttons");
config_PutInt(VLCIntf, "macosx-show-playback-buttons", b_value); config_PutInt(VLCIntf, "macosx-show-playback-buttons", b_value);
[[[[VLCMain sharedInstance] mainWindow] controlsBar] toggleJumpButtons]; [[[[VLCMain sharedInstance] mainWindow] controlsBar] toggleJumpButtons];
[[[VLCMain sharedInstance] voutController] updateWindowsUsingBlock:^(VLCVideoWindowCommon *o_window) {
[[o_window controlsBar] toggleForwardBackwardMode: b_value];
}];
[o_mi_toggleJumpButtons setState: b_value]; [o_mi_toggleJumpButtons setState: b_value];
} }
......
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