mirror of
https://github.com/danbee/persephone
synced 2025-03-04 08:39:11 +00:00
Added volume label
This commit is contained in:
parent
3b48a721fd
commit
67f8dd1192
@ -29,10 +29,12 @@ class VolumeControlView: NSViewController {
|
|||||||
if newVolume != currentVolume {
|
if newVolume != currentVolume {
|
||||||
App.mpdClient.setVolume(to: newVolume)
|
App.mpdClient.setVolume(to: newVolume)
|
||||||
currentVolume = newVolume
|
currentVolume = newVolume
|
||||||
|
volumeLabel.stringValue = String(currentVolume)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@IBOutlet var volumeSlider: NSSlider!
|
@IBOutlet var volumeSlider: NSSlider!
|
||||||
|
@IBOutlet var volumeLabel: NSTextField!
|
||||||
}
|
}
|
||||||
|
|
||||||
extension VolumeControlView: StoreSubscriber {
|
extension VolumeControlView: StoreSubscriber {
|
||||||
@ -41,5 +43,6 @@ extension VolumeControlView: StoreSubscriber {
|
|||||||
func newState(state: StoreSubscriberStateType) {
|
func newState(state: StoreSubscriberStateType) {
|
||||||
volumeSlider.integerValue = state.volume
|
volumeSlider.integerValue = state.volume
|
||||||
currentVolume = state.volume
|
currentVolume = state.volume
|
||||||
|
volumeLabel.stringValue = String(state.volume)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,33 +1,46 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15705" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="17156" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<deployment identifier="macosx"/>
|
<deployment identifier="macosx"/>
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15705"/>
|
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17156"/>
|
||||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<objects>
|
<objects>
|
||||||
<customObject id="-2" userLabel="File's Owner" customClass="VolumeControlView" customModule="Persephone" customModuleProvider="target">
|
<customObject id="-2" userLabel="File's Owner" customClass="VolumeControlView" customModule="Persephone" customModuleProvider="target">
|
||||||
<connections>
|
<connections>
|
||||||
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
|
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
|
||||||
|
<outlet property="volumeLabel" destination="8rn-8o-AUj" id="fx9-Ai-fG7"/>
|
||||||
<outlet property="volumeSlider" destination="E78-vZ-qV0" id="7qP-Fm-MDY"/>
|
<outlet property="volumeSlider" destination="E78-vZ-qV0" id="7qP-Fm-MDY"/>
|
||||||
</connections>
|
</connections>
|
||||||
</customObject>
|
</customObject>
|
||||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||||
<customView id="Hz6-mo-xeY">
|
<customView id="Hz6-mo-xeY">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="36" height="145"/>
|
<rect key="frame" x="0.0" y="0.0" width="36" height="161"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<slider horizontalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="E78-vZ-qV0" userLabel="Volume Slider">
|
<slider horizontalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="E78-vZ-qV0" userLabel="Volume Slider">
|
||||||
<rect key="frame" x="9" y="12" width="19" height="121"/>
|
<rect key="frame" x="9" y="28" width="19" height="121"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||||
<sliderCell key="cell" continuous="YES" alignment="left" maxValue="100" doubleValue="50" tickMarkPosition="right" sliderType="linear" id="22u-9w-IXT"/>
|
<sliderCell key="cell" continuous="YES" alignment="left" maxValue="100" doubleValue="50" tickMarkPosition="right" sliderType="linear" id="22u-9w-IXT"/>
|
||||||
<connections>
|
<connections>
|
||||||
<action selector="volumeSliderAction:" target="-2" id="1yh-vH-sgN"/>
|
<action selector="volumeSliderAction:" target="-2" id="1yh-vH-sgN"/>
|
||||||
</connections>
|
</connections>
|
||||||
</slider>
|
</slider>
|
||||||
|
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8rn-8o-AUj">
|
||||||
|
<rect key="frame" x="-2" y="0.0" width="40" height="23"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||||
|
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="Vol" placeholderString="50" id="CPT-Ih-89A">
|
||||||
|
<font key="font" metaFont="system"/>
|
||||||
|
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||||
|
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||||
|
</textFieldCell>
|
||||||
|
<connections>
|
||||||
|
<action selector="label:" target="-2" id="NaR-8h-tbQ"/>
|
||||||
|
</connections>
|
||||||
|
</textField>
|
||||||
</subviews>
|
</subviews>
|
||||||
<point key="canvasLocation" x="-83" y="90.5"/>
|
<point key="canvasLocation" x="-83" y="98.5"/>
|
||||||
</customView>
|
</customView>
|
||||||
</objects>
|
</objects>
|
||||||
</document>
|
</document>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user