Skip to content

Commit 68ad991

Browse files
authored
Updated how 'Show advanced settings' works (MonitorControl#714)
1 parent 1f595ff commit 68ad991

File tree

33 files changed

+273
-654
lines changed

33 files changed

+273
-654
lines changed

.github/pref_1.png

-389 KB
Loading

.github/pref_2.png

-326 KB
Loading

.github/pref_3.png

-362 KB
Loading

.github/pref_4.png

-341 KB
Loading

.github/screenshot.png

271 KB
Loading

MonitorControl/Enums/PrefKey.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ enum PrefKey: String {
4545
// Use separated OSD scale for combined brightness
4646
case separateCombinedScale
4747

48-
// Fallback to software control for other displays with no DDC
49-
case disableSoftwareFallback
50-
5148
// Do not show sliders for Apple displays (including built-in display) in menu
5249
case hideAppleFromMenu
5350

MonitorControl/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleShortVersionString</key>
2020
<string>$(MARKETING_VERSION)</string>
2121
<key>CFBundleVersion</key>
22-
<string>6632</string>
22+
<string>6670</string>
2323
<key>LSApplicationCategoryType</key>
2424
<string>public.app-category.utilities</string>
2525
<key>LSMinimumSystemVersion</key>

MonitorControl/Model/Display.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ class Display: Equatable {
269269

270270
func checkGammaInterference() {
271271
let currentSwBrightness = self.getSwBrightness()
272-
guard !DisplayManager.shared.gammaInterferenceWarningShown, !(prefs.bool(forKey: PrefKey.disableSoftwareFallback.rawValue) && prefs.bool(forKey: PrefKey.disableCombinedBrightness.rawValue)), !self.readPrefAsBool(key: .avoidGamma), !self.smoothBrightnessRunning, self.prefExists(key: .SwBrightness), abs(currentSwBrightness - self.readPrefAsFloat(key: .SwBrightness)) > 0.02 else {
272+
guard !DisplayManager.shared.gammaInterferenceWarningShown, !(prefs.bool(forKey: PrefKey.disableCombinedBrightness.rawValue)), !self.readPrefAsBool(key: .avoidGamma), !self.smoothBrightnessRunning, self.prefExists(key: .SwBrightness), abs(currentSwBrightness - self.readPrefAsFloat(key: .SwBrightness)) > 0.02 else {
273273
return
274274
}
275275
DisplayManager.shared.gammaInterferenceCounter += 1

MonitorControl/Model/OtherDisplay.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,7 @@ class OtherDisplay: Display {
298298

299299
override func stepBrightness(isUp: Bool, isSmallIncrement: Bool) {
300300
if self.isSw() {
301-
if !prefs.bool(forKey: PrefKey.disableSoftwareFallback.rawValue) {
302-
super.stepBrightness(isUp: isUp, isSmallIncrement: isSmallIncrement)
303-
}
301+
super.stepBrightness(isUp: isUp, isSmallIncrement: isSmallIncrement)
304302
return
305303
}
306304
guard !self.readPrefAsBool(key: .unavailableDDC, for: .brightness) else {

MonitorControl/Support/AppDelegate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
141141
DisplayManager.shared.setupOtherDisplays(firstrun: firstrun)
142142
self.updateMenusAndKeys()
143143
if !firstrun {
144-
if !prefs.bool(forKey: PrefKey.disableSoftwareFallback.rawValue) || !prefs.bool(forKey: PrefKey.disableCombinedBrightness.rawValue) {
144+
if !prefs.bool(forKey: PrefKey.disableCombinedBrightness.rawValue) {
145145
DisplayManager.shared.restoreSwBrightnessForAllDisplays(async: !prefs.bool(forKey: PrefKey.disableSmoothBrightness.rawValue))
146146
}
147147
}
@@ -250,7 +250,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
250250

251251
func preferenceReset() {
252252
os_log("Resetting all preferences.")
253-
if !prefs.bool(forKey: PrefKey.disableSoftwareFallback.rawValue) || !prefs.bool(forKey: PrefKey.disableCombinedBrightness.rawValue) {
253+
if !prefs.bool(forKey: PrefKey.disableCombinedBrightness.rawValue) {
254254
DisplayManager.shared.resetSwBrightnessForAllDisplays(async: false)
255255
}
256256
if let bundleID = Bundle.main.bundleIdentifier {

0 commit comments

Comments
 (0)