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 @@
@property (readonly) id bottomBarView;
- (CGFloat)height;
- (void)toggleForwardBackwardMode:(BOOL)b_alt;
- (IBAction)play:(id)sender;
- (IBAction)bwd:(id)sender;
......
......@@ -156,6 +156,9 @@
[o_fullscreen_btn removeFromSuperviewWithoutNeedingDisplay];
}
if (config_GetInt(VLCIntf, "macosx-show-playback-buttons"))
[self toggleForwardBackwardMode: YES];
}
- (CGFloat)height
......@@ -163,6 +166,26 @@
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 Button Actions
......@@ -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
{
float f_updated;
......@@ -740,10 +774,6 @@ else \
[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;
frame = [o_bwd_btn frame];
frame.size.width--;
......@@ -804,8 +834,7 @@ else \
[o_bottombar_view performSelector:@selector(addSubview:) withObject:o_next_btn afterDelay:.2];
}
[o_fwd_btn setAction:@selector(forward:)];
[o_bwd_btn setAction:@selector(backward:)];
[self toggleForwardBackwardMode: YES];
}
- (void)removeJumpButtons:(BOOL)b_fast
......@@ -827,10 +856,6 @@ else \
[o_next_btn release];
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;
frame = [o_bwd_btn frame];
frame.size.width++;
......@@ -879,10 +904,9 @@ else \
[[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_bwd_btn setAction:@selector(bwd:)];
[o_bottombar_view setNeedsDisplay:YES];
}
- (void)togglePlaymodeButtons
......@@ -974,17 +998,6 @@ else \
[[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
{
[o_repeat_btn setImage: o_repeat_one_img];
......
......@@ -707,7 +707,12 @@ static VLCMainMenu *_o_sharedInstance = nil;
{
BOOL b_value = !config_GetInt(VLCIntf, "macosx-show-playback-buttons");
config_PutInt(VLCIntf, "macosx-show-playback-buttons", b_value);
[[[[VLCMain sharedInstance] mainWindow] controlsBar] toggleJumpButtons];
[[[VLCMain sharedInstance] voutController] updateWindowsUsingBlock:^(VLCVideoWindowCommon *o_window) {
[[o_window controlsBar] toggleForwardBackwardMode: 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