diff --git a/Aerial/Source/Controllers/PreferencesWindowController.swift b/Aerial/Source/Controllers/PreferencesWindowController.swift index ebf07e3c..3f1bb4c2 100644 --- a/Aerial/Source/Controllers/PreferencesWindowController.swift +++ b/Aerial/Source/Controllers/PreferencesWindowController.swift @@ -578,11 +578,16 @@ class PreferencesWindowController: NSWindowController, NSOutlineViewDataSource, @IBAction func alternateVideoFormatChange(_ sender: NSPopUpButton) { debugLog("UI alternatePopupVideoFormat: \(sender.indexOfSelectedItem)") preferences.alternateVideoFormat = sender.indexOfSelectedItem + changeBatteryOverrideState(to: true) } func changeBatteryOverrideState(to: Bool) { - powerSavingOnLowBatteryCheckbox.isEnabled = to alternatePopupVideoFormat.isEnabled = to + if !to || (to && preferences.alternateVideoFormat != Preferences.AlternateVideoFormat.powerSaving.rawValue) { + powerSavingOnLowBatteryCheckbox.isEnabled = to + } else { + powerSavingOnLowBatteryCheckbox.isEnabled = false + } } @IBAction func popupVideoFormatChange(_ sender: NSPopUpButton) { diff --git a/Aerial/Source/Views/AerialView.swift b/Aerial/Source/Views/AerialView.swift index 68bb80cc..f3162f99 100644 --- a/Aerial/Source/Views/AerialView.swift +++ b/Aerial/Source/Views/AerialView.swift @@ -173,9 +173,10 @@ class AerialView: ScreenSaverView { let preferences = Preferences.sharedInstance let timeManagement = TimeManagement.sharedInstance - if preferences.overrideOnBattery && timeManagement.isOnBattery() { + if preferences.overrideOnBattery && timeManagement.isOnBattery() && !isPreview { if preferences.alternateVideoFormat == Preferences.AlternateVideoFormat.powerSaving.rawValue || (preferences.powerSavingOnLowBattery && timeManagement.isBatteryLow()) { + isDisabled = true timeManagement.setBrightness(level: 0.0) return }