From 67f8dd11923e7ebada8f0c9341d7ecf5da1c4a08 Mon Sep 17 00:00:00 2001 From: nopeinomicon Date: Mon, 28 Sep 2020 20:32:03 -0600 Subject: [PATCH] Added volume label --- .../VolumeControl/VolumeControlView.swift | 3 +++ .../VolumeControl/VolumeControlView.xib | 23 +++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Mac/Components/VolumeControl/VolumeControlView.swift b/Mac/Components/VolumeControl/VolumeControlView.swift index 1c6ed12..6ea83b3 100644 --- a/Mac/Components/VolumeControl/VolumeControlView.swift +++ b/Mac/Components/VolumeControl/VolumeControlView.swift @@ -29,10 +29,12 @@ class VolumeControlView: NSViewController { if newVolume != currentVolume { App.mpdClient.setVolume(to: newVolume) currentVolume = newVolume + volumeLabel.stringValue = String(currentVolume) } } @IBOutlet var volumeSlider: NSSlider! + @IBOutlet var volumeLabel: NSTextField! } extension VolumeControlView: StoreSubscriber { @@ -41,5 +43,6 @@ extension VolumeControlView: StoreSubscriber { func newState(state: StoreSubscriberStateType) { volumeSlider.integerValue = state.volume currentVolume = state.volume + volumeLabel.stringValue = String(state.volume) } } diff --git a/Mac/Components/VolumeControl/VolumeControlView.xib b/Mac/Components/VolumeControl/VolumeControlView.xib index e34fb9e..cabb072 100644 --- a/Mac/Components/VolumeControl/VolumeControlView.xib +++ b/Mac/Components/VolumeControl/VolumeControlView.xib @@ -1,33 +1,46 @@ - + - + + - + - + + + + + + + + + + + + + - +