[vlc-commits] macosx: Remove resizeView and VLCResizeControl

David Fuhrmann git at videolan.org
Sat Jun 17 14:56:42 CEST 2017


vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sat Jun 17 14:54:26 2017 +0200| [314bbc36c123607eb22a5c1ba17ddab4148341de] | committer: David Fuhrmann

macosx: Remove resizeView and VLCResizeControl

This was needed for macOS < 10.7 to draw a resize control on the
bottom right corner of black windows. Starting with 10.7,
borderless windows are resizabe as well by the window resizable mask,
thus all this code can be removed now.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=314bbc36c123607eb22a5c1ba17ddab4148341de
---

 modules/gui/macosx/UI/DetachedVideoWindow.xib | 19 +++------
 modules/gui/macosx/UI/MainWindow.xib          | 11 -----
 modules/gui/macosx/VLCControlsBarCommon.h     |  3 --
 modules/gui/macosx/VLCControlsBarCommon.m     |  7 ----
 modules/gui/macosx/VLCMainWindowControlsBar.h |  2 -
 modules/gui/macosx/VLCMainWindowTitleView.h   |  4 --
 modules/gui/macosx/VLCMainWindowTitleView.m   | 58 ---------------------------
 7 files changed, 5 insertions(+), 99 deletions(-)

diff --git a/modules/gui/macosx/UI/DetachedVideoWindow.xib b/modules/gui/macosx/UI/DetachedVideoWindow.xib
index b5f0f29922..ce08ee937e 100644
--- a/modules/gui/macosx/UI/DetachedVideoWindow.xib
+++ b/modules/gui/macosx/UI/DetachedVideoWindow.xib
@@ -1,7 +1,6 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G1421" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="16F73" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
     <dependencies>
-        <deployment identifier="macosx"/>
         <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
     </dependencies>
     <objects>
@@ -16,7 +15,7 @@
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" topStrut="YES"/>
             <rect key="contentRect" x="91" y="467" width="363" height="239"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1280" height="777"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1280" height="778"/>
             <view key="contentView" id="4">
                 <rect key="frame" x="0.0" y="0.0" width="363" height="239"/>
                 <autoresizingMask key="autoresizingMask"/>
@@ -176,8 +175,8 @@
                                             <customView hidden="YES" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="19" customClass="VLCThreePartImageView">
                                                 <rect key="frame" x="1" y="1" width="60" height="12"/>
                                             </customView>
-                                            <slider hidden="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="20" customClass="TimeLineSlider">
-                                                <rect key="frame" x="0.0" y="0.0" width="170" height="17"/>
+                                            <slider hidden="YES" verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="20" customClass="TimeLineSlider">
+                                                <rect key="frame" x="0.0" y="0.0" width="170" height="15"/>
                                                 <sliderCell key="cell" controlSize="small" continuous="YES" state="on" alignment="left" maxValue="10000" doubleValue="3260.3068524096384" tickMarkPosition="above" sliderType="linear" id="23">
                                                     <font key="font" size="12" name="Helvetica"/>
                                                 </sliderCell>
@@ -225,10 +224,6 @@
                                             <action selector="fullscreen:" target="3" id="37"/>
                                         </connections>
                                     </button>
-                                    <imageView translatesAutoresizingMaskIntoConstraints="NO" id="7" customClass="VLCResizeControl">
-                                        <rect key="frame" x="351" y="0.0" width="12" height="12"/>
-                                        <imageCell key="cell" continuous="YES" refusesFirstResponder="YES" alignment="left" image="window-resize" id="18"/>
-                                    </imageView>
                                 </subviews>
                                 <constraints>
                                     <constraint firstItem="9" firstAttribute="centerY" secondItem="6" secondAttribute="centerY" id="7ZU-On-ZZb"/>
@@ -238,7 +233,6 @@
                                     <constraint firstItem="Vae-cT-EEI" firstAttribute="centerY" secondItem="65" secondAttribute="centerY" id="L8J-t8-eZg"/>
                                     <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">
@@ -249,7 +243,6 @@
                                             </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"/>
                                 </constraints>
@@ -309,7 +302,6 @@
                 <outlet property="playButton" destination="10" id="Gsq-tx-qf3"/>
                 <outlet property="progressBar" destination="21" id="lME-my-FW0"/>
                 <outlet property="progressView" destination="6" id="Z9X-x2-mTB"/>
-                <outlet property="resizeView" destination="7" id="3ba-BO-w95"/>
                 <outlet property="timeField" destination="9" id="uzI-2c-bs3"/>
                 <outlet property="timeSlider" destination="20" id="AFS-sq-vuw"/>
                 <outlet property="timeSliderBackgroundView" destination="22" id="jag-ln-qOC"/>
@@ -326,6 +318,5 @@
         <image name="fullscreen-double-buttons-pressed" width="29" height="23"/>
         <image name="play" width="27" height="23"/>
         <image name="play-pressed" width="27" height="23"/>
-        <image name="window-resize" width="12" height="12"/>
     </resources>
 </document>
diff --git a/modules/gui/macosx/UI/MainWindow.xib b/modules/gui/macosx/UI/MainWindow.xib
index d4adcff9db..270656c869 100644
--- a/modules/gui/macosx/UI/MainWindow.xib
+++ b/modules/gui/macosx/UI/MainWindow.xib
@@ -744,16 +744,8 @@
                                             <constraint firstAttribute="right" secondItem="4419" secondAttribute="right" id="teb-w0-7R0"/>
                                         </constraints>
                                     </customView>
-                                    <imageView translatesAutoresizingMaskIntoConstraints="NO" id="4839" customClass="VLCResizeControl">
-                                        <rect key="frame" x="704" y="0.0" width="12" height="14"/>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="14" id="Wff-4H-UIV"/>
-                                        </constraints>
-                                        <imageCell key="cell" continuous="YES" refusesFirstResponder="YES" alignment="left" image="window-resize" id="4840"/>
-                                    </imageView>
                                 </subviews>
                                 <constraints>
-                                    <constraint firstAttribute="bottom" secondItem="4839" secondAttribute="bottom" id="4QS-9X-8lN"/>
                                     <constraint firstItem="3653" firstAttribute="centerY" secondItem="5608" secondAttribute="centerY" id="5K8-hV-nOQ"/>
                                     <constraint firstItem="mrr-Bw-co0" firstAttribute="centerY" secondItem="5608" secondAttribute="centerY" id="5tM-K0-mjZ"/>
                                     <constraint firstItem="3652" firstAttribute="leading" secondItem="3649" secondAttribute="trailing" constant="3" id="Apb-gM-P9J"/>
@@ -767,7 +759,6 @@
                                     <constraint firstItem="4417" firstAttribute="leading" secondItem="3649" secondAttribute="leading" id="b86-zP-VqN"/>
                                     <constraint firstItem="4417" firstAttribute="centerY" secondItem="5608" secondAttribute="centerY" id="gI8-2E-JGT"/>
                                     <constraint firstItem="dff-fl-Mde" firstAttribute="centerY" secondItem="5608" secondAttribute="centerY" id="gqZ-nc-67e"/>
-                                    <constraint firstAttribute="trailing" secondItem="4839" secondAttribute="trailing" id="jMi-9b-nsp"/>
                                     <constraint firstItem="3649" firstAttribute="centerY" secondItem="5608" secondAttribute="centerY" id="ll4-Gr-Hs6"/>
                                     <constraint firstItem="3652" firstAttribute="centerY" secondItem="5608" secondAttribute="centerY" id="o7m-oP-mfd"/>
                                     <constraint firstItem="jlp-Z2-Qdl" firstAttribute="leading" secondItem="5608" secondAttribute="leading" constant="6" id="odn-Ek-4d1"/>
@@ -858,7 +849,6 @@
                 <outlet property="progressBar" destination="3584" id="d57-az-Grm"/>
                 <outlet property="progressView" destination="5335" id="dBT-U1-rmL"/>
                 <outlet property="repeatButton" destination="2789" id="lRj-JN-Yry"/>
-                <outlet property="resizeView" destination="4839" id="26r-ET-oqH"/>
                 <outlet property="shuffleButton" destination="2208" id="kf1-mU-75T"/>
                 <outlet property="stopButton" destination="3647" id="ddx-Gq-iPV"/>
                 <outlet property="timeField" destination="4423" id="Wvo-az-Lou"/>
@@ -1068,6 +1058,5 @@ Gw
         <image name="volume-high" width="13" height="11"/>
         <image name="volume-low" width="5" height="11"/>
         <image name="volume-slider-track" width="48" height="5"/>
-        <image name="window-resize" width="12" height="12"/>
     </resources>
 </document>
diff --git a/modules/gui/macosx/VLCControlsBarCommon.h b/modules/gui/macosx/VLCControlsBarCommon.h
index e2d863912a..18a55f1778 100644
--- a/modules/gui/macosx/VLCControlsBarCommon.h
+++ b/modules/gui/macosx/VLCControlsBarCommon.h
@@ -27,8 +27,6 @@
 
 #import "VLCTimeField.h"
 
- at class VLCResizeControl;
-
 /*****************************************************************************
  * VLCControlsBarCommon
  *
@@ -52,7 +50,6 @@
 
 @property (readwrite, strong) IBOutlet VLCTimeField *timeField;
 @property (readwrite, strong) IBOutlet NSButton *fullscreenButton;
- at property (readwrite, strong) IBOutlet VLCResizeControl *resizeView;
 
 @property (readwrite, strong) IBOutlet VLCThreePartImageView *bottomBarView;
 
diff --git a/modules/gui/macosx/VLCControlsBarCommon.m b/modules/gui/macosx/VLCControlsBarCommon.m
index 35dc8321e7..642a1cce73 100644
--- a/modules/gui/macosx/VLCControlsBarCommon.m
+++ b/modules/gui/macosx/VLCControlsBarCommon.m
@@ -144,13 +144,6 @@
     frame.size.width = 0;
     [_timeSliderGradientView setFrame: frame];
 
-    // hide resize view if necessary
-    [self.resizeView setImage: NULL];
-
-    if ([[self.bottomBarView window] styleMask] & NSResizableWindowMask)
-        [self.resizeView removeFromSuperviewWithoutNeedingDisplay];
-
-
     // remove fullscreen button for lion fullscreen
     if (_nativeFullscreenMode) {
         [self.fullscreenButton removeFromSuperview];
diff --git a/modules/gui/macosx/VLCMainWindowControlsBar.h b/modules/gui/macosx/VLCMainWindowControlsBar.h
index e94d12fd38..a9e66acc51 100644
--- a/modules/gui/macosx/VLCMainWindowControlsBar.h
+++ b/modules/gui/macosx/VLCMainWindowControlsBar.h
@@ -26,8 +26,6 @@
 #import "misc.h"
 #import "VLCControlsBarCommon.h"
 
- at class VLCResizeControl;
-
 /*****************************************************************************
  * VLCMainWindowControlsBar
  *
diff --git a/modules/gui/macosx/VLCMainWindowTitleView.h b/modules/gui/macosx/VLCMainWindowTitleView.h
index d75b289dce..4920b78d59 100644
--- a/modules/gui/macosx/VLCMainWindowTitleView.h
+++ b/modules/gui/macosx/VLCMainWindowTitleView.h
@@ -59,10 +59,6 @@
 
 @end
 
- at interface VLCResizeControl : NSImageView
-
- at end
-
 @interface VLCColorView : NSView
 
 @end
diff --git a/modules/gui/macosx/VLCMainWindowTitleView.m b/modules/gui/macosx/VLCMainWindowTitleView.m
index 0f347d21e5..a30d81c6ec 100644
--- a/modules/gui/macosx/VLCMainWindowTitleView.m
+++ b/modules/gui/macosx/VLCMainWindowTitleView.m
@@ -365,64 +365,6 @@
 
 
 /*****************************************************************************
- * VLCResizeControl
- *
- * For Leopard and Snow Leopard, we need to emulate the resize control on the
- * bottom right of the window, since it is gone by using the borderless window
- * mask. A proper fix would be Lion-only.
- *****************************************************************************/
-
- at implementation VLCResizeControl
-
-- (void)mouseDown:(NSEvent *)theEvent {
-    BOOL keepOn = YES;
-
-    while (keepOn) {
-        theEvent = [[self window] nextEventMatchingMask: NSLeftMouseUpMask |
-                    NSLeftMouseDraggedMask];
-
-        switch ([theEvent type]) {
-            case NSLeftMouseDragged:
-            {
-                NSRect windowFrame = [[self window] frame];
-                CGFloat deltaX, deltaY, oldOriginY;
-                deltaX = [theEvent deltaX];
-                deltaY = [theEvent deltaY];
-                oldOriginY = windowFrame.origin.y;
-
-                windowFrame.origin.y = (oldOriginY + windowFrame.size.height) - (windowFrame.size.height + deltaY);
-                windowFrame.size.width += deltaX;
-                windowFrame.size.height += deltaY;
-
-                NSSize winMinSize = [self window].minSize;
-                if (windowFrame.size.width < winMinSize.width)
-                    windowFrame.size.width = winMinSize.width;
-
-                if (windowFrame.size.height < winMinSize.height) {
-                    windowFrame.size.height = winMinSize.height;
-                    windowFrame.origin.y = oldOriginY;
-                }
-
-                [[self window] setFrame: windowFrame display: YES animate: NO];
-                break;
-            }
-                break;
-            case NSLeftMouseUp:
-                keepOn = NO;
-                break;
-            default:
-                /* Ignore any other kind of event. */
-                break;
-        }
-
-    };
-
-    return;
-}
-
- at end
-
-/*****************************************************************************
  * VLCColorView
  *
  * since we are using a clear window color when using the black window



More information about the vlc-commits mailing list