[vlc-commits] macosx: detached window: Hide fullscreen button if native mode is on
David Fuhrmann
git at videolan.org
Sat Apr 22 16:35:17 CEST 2017
vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sat Apr 22 09:48:40 2017 +0200| [583a75c97aea6f8bc2a05050bd34ce03bc6bef75] | committer: David Fuhrmann
macosx: detached window: Hide fullscreen button if native mode is on
Simply remove the button from the view, autolayout and lower
priority constraints take care of the rest.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=583a75c97aea6f8bc2a05050bd34ce03bc6bef75
---
modules/gui/macosx/UI/DetachedVideoWindow.xib | 10 ++++++++++
modules/gui/macosx/VLCControlsBarCommon.m | 7 ++++---
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/modules/gui/macosx/UI/DetachedVideoWindow.xib b/modules/gui/macosx/UI/DetachedVideoWindow.xib
index 45d42158ae..08f8cb6f53 100644
--- a/modules/gui/macosx/UI/DetachedVideoWindow.xib
+++ b/modules/gui/macosx/UI/DetachedVideoWindow.xib
@@ -239,6 +239,16 @@
<constraint firstItem="9" firstAttribute="leading" secondItem="6" secondAttribute="trailing" constant="4" id="P5c-gH-8J6"/>
<constraint firstItem="6" firstAttribute="centerY" secondItem="Vae-cT-EEI" secondAttribute="centerY" id="cvI-P6-Eda"/>
<constraint firstAttribute="bottom" secondItem="7" secondAttribute="bottom" id="eiE-5I-gND"/>
+ <constraint firstAttribute="trailing" secondItem="9" secondAttribute="trailing" priority="250" constant="7" id="fzk-WE-wjs">
+ <attributedString key="userComments">
+ <fragment content="optional constraint if fullscreen button is not there">
+ <attributes>
+ <font key="NSFont" metaFont="smallSystem"/>
+ <paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
+ </attributes>
+ </fragment>
+ </attributedString>
+ </constraint>
<constraint firstAttribute="trailing" secondItem="7" secondAttribute="trailing" id="ixf-mR-2yO"/>
<constraint firstItem="Vae-cT-EEI" firstAttribute="leading" secondItem="65" secondAttribute="leading" constant="6" id="ju1-w7-CzH"/>
<constraint firstItem="8" firstAttribute="leading" secondItem="9" secondAttribute="trailing" constant="5" id="qs6-O2-pGr"/>
diff --git a/modules/gui/macosx/VLCControlsBarCommon.m b/modules/gui/macosx/VLCControlsBarCommon.m
index 7ff193d504..053733bcbb 100644
--- a/modules/gui/macosx/VLCControlsBarCommon.m
+++ b/modules/gui/macosx/VLCControlsBarCommon.m
@@ -54,8 +54,8 @@
- (void)awakeFromNib
{
- _darkInterface = config_GetInt(getIntf(), "macosx-interfacestyle");
- _nativeFullscreenMode = NO;
+ _darkInterface = var_InheritBool(getIntf(), "macosx-interfacestyle");
+ _nativeFullscreenMode = var_InheritBool(getIntf(), "macosx-nativefullscreenmode");
[self.dropView setDrawBorder: NO];
@@ -153,6 +153,7 @@
// remove fullscreen button for lion fullscreen
if (_nativeFullscreenMode) {
+ // TODO remove frame calculations
CGFloat f_width = [self.fullscreenButton frame].size.width;
NSRect frame = [self.timeField frame];
@@ -163,7 +164,7 @@
frame.size.width = f_width + frame.size.width;
[self.progressView setFrame: frame];
- [self.fullscreenButton removeFromSuperviewWithoutNeedingDisplay];
+ [self.fullscreenButton removeFromSuperview];
}
if (config_GetInt(getIntf(), "macosx-show-playback-buttons"))
More information about the vlc-commits
mailing list