macosx: Remove resizeView and VLCResizeControl
authorDavid Fuhrmann <dfuhrmann@videolan.org>
Sat, 17 Jun 2017 12:54:26 +0000 (14:54 +0200)
committerDavid Fuhrmann <dfuhrmann@videolan.org>
Sat, 17 Jun 2017 12:56:40 +0000 (14:56 +0200)
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.

modules/gui/macosx/UI/DetachedVideoWindow.xib
modules/gui/macosx/UI/MainWindow.xib
modules/gui/macosx/VLCControlsBarCommon.h
modules/gui/macosx/VLCControlsBarCommon.m
modules/gui/macosx/VLCMainWindowControlsBar.h
modules/gui/macosx/VLCMainWindowTitleView.h
modules/gui/macosx/VLCMainWindowTitleView.m

index b5f0f29..ce08ee9 100644 (file)
@@ -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"/>
                                             <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>
                                             <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"/>
                                     <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">
                                             </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>
                 <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"/>
         <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>
index d4adcff..270656c 100644 (file)
                                             <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"/>
                                     <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"/>
                 <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>
index e2d8639..18a55f1 100644 (file)
@@ -27,8 +27,6 @@
 
 #import "VLCTimeField.h"
 
-@class VLCResizeControl;
-
 /*****************************************************************************
  * VLCControlsBarCommon
  *
@@ -52,7 +50,6 @@
 
 @property (readwrite, strong) IBOutlet VLCTimeField *timeField;
 @property (readwrite, strong) IBOutlet NSButton *fullscreenButton;
-@property (readwrite, strong) IBOutlet VLCResizeControl *resizeView;
 
 @property (readwrite, strong) IBOutlet VLCThreePartImageView *bottomBarView;
 
index 35dc832..642a1cc 100644 (file)
     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];
index e94d12f..a9e66ac 100644 (file)
@@ -26,8 +26,6 @@
 #import "misc.h"
 #import "VLCControlsBarCommon.h"
 
-@class VLCResizeControl;
-
 /*****************************************************************************
  * VLCMainWindowControlsBar
  *
index d75b289..4920b78 100644 (file)
 
 @end
 
-@interface VLCResizeControl : NSImageView
-
-@end
-
 @interface VLCColorView : NSView
 
 @end
index 0f347d2..a30d81c 100644 (file)
 @end
 
 
-/*****************************************************************************
- * 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.
- *****************************************************************************/
-
-@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;
-}
-
-@end
-
 /*****************************************************************************
  * VLCColorView
  *