Browse Source

Cleaning up.

pull/101/head
Abhishek 3 years ago
parent
commit
1effa1b9d4
  1. 38
      Clocker/Clocker/en.lproj/Panel.xib
  2. 10
      Clocker/Panel/ParentPanelController+ModernSlider.swift

38
Clocker/Clocker/en.lproj/Panel.xib

@ -18,7 +18,6 @@
<outlet property="mainTableView" destination="dFw-ts-8OZ" id="2kY-dd-rDV"/> <outlet property="mainTableView" destination="dFw-ts-8OZ" id="2kY-dd-rDV"/>
<outlet property="modernContainerView" destination="8W7-rS-Uob" id="qgZ-SS-ayy"/> <outlet property="modernContainerView" destination="8W7-rS-Uob" id="qgZ-SS-ayy"/>
<outlet property="modernSlider" destination="lxA-64-3QU" id="kS5-ub-7gV"/> <outlet property="modernSlider" destination="lxA-64-3QU" id="kS5-ub-7gV"/>
<outlet property="modernSliderLabel" destination="pi8-wk-eXa" id="yLU-nz-IBx"/>
<outlet property="nextEventLabel" destination="rld-Ag-KL1" id="GTY-j3-A1g"/> <outlet property="nextEventLabel" destination="rld-Ag-KL1" id="GTY-j3-A1g"/>
<outlet property="pinButton" destination="YXE-4J-5cn" id="k6V-HK-7XG"/> <outlet property="pinButton" destination="YXE-4J-5cn" id="k6V-HK-7XG"/>
<outlet property="preferencesButton" destination="Ctq-BV-GPN" id="cdL-5h-qmx"/> <outlet property="preferencesButton" destination="Ctq-BV-GPN" id="cdL-5h-qmx"/>
@ -42,16 +41,16 @@
<windowCollectionBehavior key="collectionBehavior" moveToActiveSpace="YES" ignoresCycle="YES"/> <windowCollectionBehavior key="collectionBehavior" moveToActiveSpace="YES" ignoresCycle="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/> <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="1000" y="379" width="350" height="460"/> <rect key="contentRect" x="1000" y="379" width="350" height="460"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/> <rect key="screenRect" x="0.0" y="0.0" width="1680" height="1025"/>
<view key="contentView" focusRingType="none" misplaced="YES" id="6" customClass="BackgroundPanelView" customModule="Clocker" customModuleProvider="target"> <view key="contentView" focusRingType="none" misplaced="YES" id="6" customClass="BackgroundPanelView" customModule="Clocker" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="350" height="460"/> <rect key="frame" x="0.0" y="0.0" width="350" height="460"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<stackView focusRingType="none" distribution="fill" orientation="vertical" alignment="leading" spacing="0.0" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="OZA-6o-SbE"> <stackView focusRingType="none" distribution="fill" orientation="vertical" alignment="leading" spacing="0.0" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="OZA-6o-SbE">
<rect key="frame" x="0.0" y="0.0" width="350" height="455"/> <rect key="frame" x="0.0" y="0.0" width="350" height="430"/>
<subviews> <subviews>
<scrollView focusRingType="none" borderType="none" autohidesScrollers="YES" horizontalLineScroll="96" horizontalPageScroll="1" verticalLineScroll="96" verticalPageScroll="1" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" scrollerKnobStyle="light" translatesAutoresizingMaskIntoConstraints="NO" id="4Gd-Nv-fXr"> <scrollView focusRingType="none" borderType="none" autohidesScrollers="YES" horizontalLineScroll="96" horizontalPageScroll="1" verticalLineScroll="96" verticalPageScroll="1" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" scrollerKnobStyle="light" translatesAutoresizingMaskIntoConstraints="NO" id="4Gd-Nv-fXr">
<rect key="frame" x="-20" y="190" width="370" height="265"/> <rect key="frame" x="-20" y="165" width="370" height="265"/>
<clipView key="contentView" focusRingType="none" drawsBackground="NO" copiesOnScroll="NO" id="4MZ-Di-yNR"> <clipView key="contentView" focusRingType="none" drawsBackground="NO" copiesOnScroll="NO" id="4MZ-Di-yNR">
<rect key="frame" x="0.0" y="0.0" width="370" height="265"/> <rect key="frame" x="0.0" y="0.0" width="370" height="265"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@ -261,7 +260,7 @@
</scroller> </scroller>
</scrollView> </scrollView>
<customView wantsLayer="YES" focusRingType="none" translatesAutoresizingMaskIntoConstraints="NO" id="C7R-Dq-MFr" userLabel="Slider View"> <customView wantsLayer="YES" focusRingType="none" translatesAutoresizingMaskIntoConstraints="NO" id="C7R-Dq-MFr" userLabel="Slider View">
<rect key="frame" x="0.0" y="250" width="350" height="30"/> <rect key="frame" x="0.0" y="135" width="350" height="30"/>
<subviews> <subviews>
<slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Vf2-uI-yf3"> <slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Vf2-uI-yf3">
<rect key="frame" x="7" y="2" width="201" height="23"/> <rect key="frame" x="7" y="2" width="201" height="23"/>
@ -310,11 +309,11 @@
</constraints> </constraints>
</customView> </customView>
<customView wantsLayer="YES" focusRingType="none" id="8W7-rS-Uob" userLabel="Modern Slider" customClass="ModernSliderContainerView" customModule="Clocker" customModuleProvider="target"> <customView wantsLayer="YES" focusRingType="none" id="8W7-rS-Uob" userLabel="Modern Slider" customClass="ModernSliderContainerView" customModule="Clocker" customModuleProvider="target">
<rect key="frame" x="0.0" y="165" width="350" height="85"/> <rect key="frame" x="0.0" y="165" width="350" height="60"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews> <subviews>
<scrollView wantsLayer="YES" borderType="none" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasVerticalScroller="NO" horizontalScrollElasticity="allowed" verticalScrollElasticity="none" translatesAutoresizingMaskIntoConstraints="NO" id="htc-pO-AqH"> <scrollView wantsLayer="YES" borderType="none" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasVerticalScroller="NO" horizontalScrollElasticity="allowed" verticalScrollElasticity="none" translatesAutoresizingMaskIntoConstraints="NO" id="htc-pO-AqH">
<rect key="frame" x="5" y="30" width="340" height="50"/> <rect key="frame" x="5" y="5" width="340" height="50"/>
<clipView key="contentView" drawsBackground="NO" id="N1e-zE-F86"> <clipView key="contentView" drawsBackground="NO" id="N1e-zE-F86">
<rect key="frame" x="0.0" y="0.0" width="340" height="50"/> <rect key="frame" x="0.0" y="0.0" width="340" height="50"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@ -343,33 +342,12 @@
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
</scroller> </scroller>
</scrollView> </scrollView>
<customView focusRingType="none" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Ool-HA-BAA" userLabel="Modern Slider Label Container" customClass="ClockerTextBackgroundView" customModule="Clocker" customModuleProvider="target">
<rect key="frame" x="105" y="0.0" width="140" height="16"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="pi8-wk-eXa">
<rect key="frame" x="29" y="0.0" width="83" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="Label Goes Here" id="ii9-w0-WDX">
<font key="font" size="12" name="Avenir-Medium"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" red="0.071000002324581146" green="0.9580000638961792" blue="0.10900000482797623" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</textFieldCell>
</textField>
</subviews>
<constraints>
<constraint firstItem="pi8-wk-eXa" firstAttribute="top" secondItem="Ool-HA-BAA" secondAttribute="top" id="7Ob-p9-mYF"/>
<constraint firstItem="pi8-wk-eXa" firstAttribute="centerX" secondItem="Ool-HA-BAA" secondAttribute="centerX" id="S4O-JK-WhU"/>
<constraint firstAttribute="bottom" secondItem="pi8-wk-eXa" secondAttribute="bottom" id="UFW-9A-xfO"/>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="140" id="oMj-PF-69w"/>
</constraints>
</customView>
</subviews> </subviews>
<constraints> <constraints>
<constraint firstAttribute="height" constant="85" id="5HT-Ps-YH3"/> <constraint firstAttribute="height" constant="60" id="5HT-Ps-YH3"/>
<constraint firstItem="htc-pO-AqH" firstAttribute="top" secondItem="8W7-rS-Uob" secondAttribute="top" constant="5" id="Ag8-2G-tVA"/> <constraint firstItem="htc-pO-AqH" firstAttribute="top" secondItem="8W7-rS-Uob" secondAttribute="top" constant="5" id="Ag8-2G-tVA"/>
<constraint firstAttribute="bottom" secondItem="Ool-HA-BAA" secondAttribute="bottom" id="Cft-IZ-bGP"/>
<constraint firstItem="htc-pO-AqH" firstAttribute="leading" secondItem="8W7-rS-Uob" secondAttribute="leading" constant="5" id="QmJ-Dd-WLb"/> <constraint firstItem="htc-pO-AqH" firstAttribute="leading" secondItem="8W7-rS-Uob" secondAttribute="leading" constant="5" id="QmJ-Dd-WLb"/>
<constraint firstItem="Ool-HA-BAA" firstAttribute="centerX" secondItem="8W7-rS-Uob" secondAttribute="centerX" id="XfN-mE-GIn"/> <constraint firstAttribute="bottom" secondItem="htc-pO-AqH" secondAttribute="bottom" priority="750" constant="5" id="YCJ-zB-dvc"/>
<constraint firstAttribute="bottom" secondItem="htc-pO-AqH" secondAttribute="bottom" priority="750" constant="30" id="YCJ-zB-dvc"/>
<constraint firstAttribute="trailing" secondItem="htc-pO-AqH" secondAttribute="trailing" constant="5" id="esR-My-uoD"/> <constraint firstAttribute="trailing" secondItem="htc-pO-AqH" secondAttribute="trailing" constant="5" id="esR-My-uoD"/>
</constraints> </constraints>
<accessibility identifier="Modern Slider"/> <accessibility identifier="Modern Slider"/>

10
Clocker/Panel/ParentPanelController+ModernSlider.swift

@ -77,10 +77,10 @@ extension ParentPanelController {
direction: .forward)! direction: .forward)!
if shouldUpdate { if shouldUpdate {
modernSliderLabel.stringValue = timezoneFormattedStringRepresentation(hourQuarterDate) // modernSliderLabel.stringValue = timezoneFormattedStringRepresentation(hourQuarterDate)
} else { } else {
let fullString = NSMutableAttributedString(string: "Time Scroller") // let fullString = NSMutableAttributedString(string: "Time Scroller")
modernSliderLabel.attributedStringValue = fullString // modernSliderLabel.attributedStringValue = fullString
} }
return hourQuarterDate return hourQuarterDate
@ -92,12 +92,12 @@ extension ParentPanelController {
if index > (centerPoint + 1) { if index > (centerPoint + 1) {
let remainder = (index % (centerPoint + 1)) let remainder = (index % (centerPoint + 1))
let nextDate = Calendar.current.date(byAdding: .minute, value: remainder * 15, to: closestQuarterTimeRepresentation ?? Date())! let nextDate = Calendar.current.date(byAdding: .minute, value: remainder * 15, to: closestQuarterTimeRepresentation ?? Date())!
modernSliderLabel.stringValue = timezoneFormattedStringRepresentation(nextDate) // modernSliderLabel.stringValue = timezoneFormattedStringRepresentation(nextDate)
return nextDate.minutes(from: Date()) + 1 return nextDate.minutes(from: Date()) + 1
} else if index <= centerPoint { } else if index <= centerPoint {
let remainder = centerPoint - index + 1 let remainder = centerPoint - index + 1
let previousDate = Calendar.current.date(byAdding: .minute, value: -1 * remainder * 15, to: closestQuarterTimeRepresentation ?? Date())! let previousDate = Calendar.current.date(byAdding: .minute, value: -1 * remainder * 15, to: closestQuarterTimeRepresentation ?? Date())!
modernSliderLabel.stringValue = timezoneFormattedStringRepresentation(previousDate) // modernSliderLabel.stringValue = timezoneFormattedStringRepresentation(previousDate)
return previousDate.minutes(from: Date()) return previousDate.minutes(from: Date())
} else { } else {
setModernSliderLabel(true) setModernSliderLabel(true)

Loading…
Cancel
Save