Skip to content

Commit 0ed9d0f

Browse files
authored
Keyboard pane now fits small screen when custom shortcuts enabled (MonitorControl#693)
- Keyboard preferences still did not fit to a 1280x800 screen if custom shortcuts were enabled. I did some redesign to fix that. - Updated dutch translation
1 parent 178ed31 commit 0ed9d0f

25 files changed

Lines changed: 572 additions & 710 deletions

File tree

MonitorControl/Enums/PrefKey.swift

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,14 @@ enum PrefKey: String {
6666
// Show advanced options under Displays tab in Preferences
6767
case showAdvancedSettings
6868

69-
// Change Brightness for all screens
70-
case allScreensBrightness
71-
7269
// Allow zero software brightness
7370
case allowZeroSwBrightness
7471

75-
// Use focus instead of mouse position to determine which display to control for brightness
76-
case useFocusInsteadOfMouse
77-
78-
// Change Volume for all screens
79-
case allScreensVolume
72+
// Keyboard brightness control for multiple displays
73+
case multiKeyboardBrightness
8074

81-
// Use audio device name matching to determine display to control for volume
82-
case useAudioDeviceNameMatching
75+
// Keyboard volume control for multiple devices
76+
case multiKeyboardVolume
8377

8478
// Use fine OSD scale for brightness
8579
case useFineScaleBrightness
@@ -164,6 +158,18 @@ enum PrefKey: String {
164158
case remapDDC
165159
}
166160

161+
enum MultiKeyboardBrightness: Int {
162+
case mouse = 0
163+
case allScreens = 1
164+
case focusInsteadOfMouse = 2
165+
}
166+
167+
enum MultiKeyboardVolume: Int {
168+
case mouse = 0
169+
case allScreens = 1
170+
case audioDeviceNameMatching = 2
171+
}
172+
167173
enum StartupAction: Int {
168174
case doNothing = 0
169175
case write = 1

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>6517</string>
22+
<string>6539</string>
2323
<key>LSApplicationCategoryType</key>
2424
<string>public.app-category.utilities</string>
2525
<key>LSMinimumSystemVersion</key>

MonitorControl/Support/DisplayManager.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,17 +347,17 @@ class DisplayManager {
347347
let allDisplays = self.getAllDisplays()
348348
var currentDisplay: Display?
349349
if isBrightness {
350-
if prefs.bool(forKey: PrefKey.allScreensBrightness.rawValue) {
350+
if prefs.integer(forKey: PrefKey.multiKeyboardBrightness.rawValue) == MultiKeyboardBrightness.allScreens.rawValue {
351351
affectedDisplays = allDisplays
352352
return affectedDisplays
353353
}
354-
currentDisplay = self.getCurrentDisplay(byFocus: prefs.bool(forKey: PrefKey.useFocusInsteadOfMouse.rawValue))
354+
currentDisplay = self.getCurrentDisplay(byFocus: prefs.integer(forKey: PrefKey.multiKeyboardBrightness.rawValue) == MultiKeyboardBrightness.focusInsteadOfMouse.rawValue)
355355
}
356356
if isVolume {
357-
if prefs.bool(forKey: PrefKey.allScreensVolume.rawValue) {
357+
if prefs.integer(forKey: PrefKey.multiKeyboardVolume.rawValue) == MultiKeyboardVolume.allScreens.rawValue {
358358
affectedDisplays = allDisplays
359359
return affectedDisplays
360-
} else if prefs.bool(forKey: PrefKey.useAudioDeviceNameMatching.rawValue) {
360+
} else if prefs.integer(forKey: PrefKey.multiKeyboardVolume.rawValue) == MultiKeyboardVolume.audioDeviceNameMatching.rawValue {
361361
return self.audioControlTargetDisplays
362362
}
363363
currentDisplay = self.getCurrentDisplay(byFocus: false)

MonitorControl/Support/MediaKeyTapManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class MediaKeyTapManager: MediaKeyTapDelegate {
175175
// Remove volume related keys if audio device is controllable
176176
if let defaultAudioDevice = app.coreAudio.defaultOutputDevice {
177177
let keysToDelete: [MediaKey] = [.volumeUp, .volumeDown, .mute]
178-
if !prefs.bool(forKey: PrefKey.allScreensVolume.rawValue), prefs.bool(forKey: PrefKey.useAudioDeviceNameMatching.rawValue) {
178+
if prefs.integer(forKey: PrefKey.multiKeyboardVolume.rawValue) == MultiKeyboardVolume.audioDeviceNameMatching.rawValue {
179179
if DisplayManager.shared.updateAudioControlTargetDisplays(deviceName: defaultAudioDevice.name) == 0 {
180180
keys.removeAll { keysToDelete.contains($0) }
181181
}

MonitorControl/UI/Base.lproj/Main.storyboard

Lines changed: 95 additions & 100 deletions
Large diffs are not rendered by default.

MonitorControl/UI/de.lproj/Main.strings

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
/* Class = "NSMenuItem"; title = "Standard keyboard volume and mute keys"; ObjectID = "1sy-Kd-WL5"; */
1111
"1sy-Kd-WL5.title" = "Standardtasten für Lautstärke und Stummschaltung";
1212

13-
/* Class = "NSButtonCell"; title = "Change volume for all screens"; ObjectID = "1XT-3S-UuD"; */
14-
"1XT-3S-UuD.title" = "Lautstärke für alle Monitore ändern";
15-
1613
/* Class = "NSTextFieldCell"; title = "DDC min"; ObjectID = "1zE-fg-xEm"; */
1714
"1zE-fg-xEm.title" = "DDC min";
1815

@@ -25,11 +22,8 @@
2522
/* Class = "NSMenuItem"; title = "Custom keyboard shortcuts"; ObjectID = "4CG-0I-anB"; */
2623
"4CG-0I-anB.title" = "Benutzerdefinierte Tastaturkürzel";
2724

28-
/* Class = "NSTextFieldCell"; title = "MonitorControl uses mouse position to determine which display to control. Using window focus instead might not work well with full screen apps."; ObjectID = "4dX-o1-xAc"; */
29-
"4dX-o1-xAc.title" = "MonitorControl verwendet die Mausposition, um zu bestimmen, welcher Monitor gesteuert werden soll. Die Verwendung des Fensterfokus könnte bei Vollbildanwendungen nicht gut funktionieren.";
30-
31-
/* Class = "NSTextField"; ibExternalAccessibilityDescription = "Brightness"; ObjectID = "567-le-fLg"; */
32-
"567-le-fLg.ibExternalAccessibilityDescription" = "Helligkeit";
25+
/* Class = "NSTextFieldCell"; title = "Using window focus might not work properly with full screen apps."; ObjectID = "4dX-o1-xAc"; */
26+
"4dX-o1-xAc.title" = "Die Verwendung des Fensterfokus könnte bei Vollbildanwendungen nicht gut funktionieren.";
3327

3428
/* Class = "NSButtonCell"; title = "Reset Preferences"; ObjectID = "5yT-5F-X5R"; */
3529
"5yT-5F-X5R.title" = "Einstellungen zurücksetzen";
@@ -46,7 +40,7 @@
4640
/* Class = "NSTextFieldCell"; title = "Slider knob will snap to 0%, 25%, 50%, 75% and 100% when in proximity making setting these values easier. Disable for finer control."; ObjectID = "8Gx-Ya-zhp"; */
4741
"8Gx-Ya-zhp.title" = "Der Regler rastet bei Annäherung auf 0 %, 25 %, 50 %, 75 % und 100 % ein, was die Einstellung dieser Werte erleichtert. Deaktivieren für genauere Kontrolle.";
4842

49-
/* Class = "NSButtonCell"; title = "Use fine OSD scale"; ObjectID = "8Q8-57-xnT"; */
43+
/* Class = "NSButtonCell"; title = "Use fine OSD scale for brightness and contrast"; ObjectID = "8Q8-57-xnT"; */
5044
"8Q8-57-xnT.title" = "Feine OSD-Skalierung verwenden";
5145

5246
/* Class = "NSButtonCell"; title = "Special thanks to our contributors!"; ObjectID = "95V-M4-2l5"; */
@@ -55,9 +49,6 @@
5549
/* Class = "NSMenuItem"; title = "Custom keyboard shortcuts"; ObjectID = "9eC-PD-FHl"; */
5650
"9eC-PD-FHl.title" = "Benutzerdefinierte Tastaturkürzel";
5751

58-
/* Class = "NSSlider"; ibExternalAccessibilityDescription = "Brightness"; ObjectID = "9H1-0z-xsx"; */
59-
"9H1-0z-xsx.ibExternalAccessibilityDescription" = "Helligkeit";
60-
6152
/* Class = "NSMenuItem"; title = "Attempt to read display settings"; ObjectID = "9yL-no-aWa"; */
6253
"9yL-no-aWa.title" = "Versuch, die Monitor-Einstellungen zu lesen";
6354

@@ -70,6 +61,9 @@
7061
/* Class = "NSTextFieldCell"; title = "Use brightness, volume and other settings from last time or use defaults. Values will be applied to the display upon first change by the user."; ObjectID = "an7-Aj-3fZ"; */
7162
"an7-Aj-3fZ.title" = "Helligkeit, Lautstärke und andere Einstellungen vom letzten Mal verwenden oder Standardwerte verwenden. Die Werte werden bei der ersten Änderung durch den Benutzer auf den Monitor angewendet.";
7263

64+
/* Class = "NSMenuItem"; title = "Use audio device name to determine which display to control"; ObjectID = "AqF-uD-KCY"; */
65+
"AqF-uD-KCY.title" = "Verwenden des Namens des Audiogeräts, um zu bestimmen, welcher Monitor gesteuert werden soll";
66+
7367
/* Class = "NSMenuItem"; title = "Show sliders only for the display currently showing the menu"; ObjectID = "bbf-sS-uGv"; */
7468
"bbf-sS-uGv.title" = "Regler nur für den Monitor anzeigen, auf dem das Menü gerade angezeigt wird";
7569

@@ -88,6 +82,9 @@
8882
/* Class = "NSTextFieldCell"; title = "OSD scale:"; ObjectID = "bP4-GJ-vhJ"; */
8983
"bP4-GJ-vhJ.title" = "OSD Skala:";
9084

85+
/* Class = "NSTextFieldCell"; title = "OSD scale:"; ObjectID = "Bqc-s3-C0w"; */
86+
"Bqc-s3-C0w.title" = "OSD Skala:";
87+
9188
/* Class = "NSButtonCell"; title = "Reset settings"; ObjectID = "BYS-7Y-bRz"; */
9289
"BYS-7Y-bRz.title" = "Zurücksetzen";
9390

@@ -115,8 +112,8 @@
115112
/* Class = "NSTextFieldCell"; title = "VCP list"; ObjectID = "D9t-vT-gNJ"; */
116113
"D9t-vT-gNJ.title" = "VCP Liste";
117114

118-
/* Class = "NSTextFieldCell"; title = "Without this the app uses mouse position to determine which display to control. You can override audio device name under Displays if needed."; ObjectID = "Dha-Tm-cDM"; */
119-
"Dha-Tm-cDM.title" = "Ohne diese Einstellung verwendet die App die Mausposition, um den zu steuernden Monitor zu bestimmen. Bei Bedarf kannst du den Namen des Audiogeräts unter Monitore überschreiben.";
115+
/* Class = "NSTextFieldCell"; title = "You can override audio device name under Displays (advanced) if needed."; ObjectID = "Dha-Tm-cDM"; */
116+
"Dha-Tm-cDM.title" = "Bei Bedarf kannst du den Namen des Audiogeräts unter Monitore überschreiben.";
120117

121118
/* Class = "NSTextFieldCell"; title = "You can disable smooth transitions for a more direct, immediate control."; ObjectID = "ENt-mP-0yH"; */
122119
"ENt-mP-0yH.title" = "Für eine direktere, unmittelbare Steuerung kannst du weiche Übergänge deaktivieren.";
@@ -163,6 +160,9 @@
163160
/* Class = "NSTextFieldCell"; title = "Invert"; ObjectID = "G5A-y3-eZz"; */
164161
"G5A-y3-eZz.title" = "Umkehren";
165162

163+
/* Class = "NSMenuItem"; title = "Use window focus to determine which display to control"; ObjectID = "gTR-FW-FHc"; */
164+
"gTR-FW-FHc.title" = "Verwende den Fensterfokus, um den zu steuernden Monitor zu bestimmen";
165+
166166
/* Class = "NSTextFieldCell"; title = "Brightness slider for hardware or software controlled displays or TVs."; ObjectID = "gXH-HL-ZOL"; */
167167
"gXH-HL-ZOL.title" = "Helligkeitsregler für hardware- oder softwaregesteuerte Monitore oder TV-Geräte.";
168168

@@ -193,18 +193,24 @@
193193
/* Class = "NSButtonCell"; title = "Start at Login"; ObjectID = "j72-NF-zsW"; */
194194
"j72-NF-zsW.title" = "Start beim Login";
195195

196-
/* Class = "NSButtonCell"; title = "Change for all screens"; ObjectID = "JC3-pb-XnR"; */
197-
"JC3-pb-XnR.title" = "Änderung für alle Monitore";
196+
/* Class = "NSMenuItem"; title = "Change for all screens"; ObjectID = "jSj-HB-T2t"; */
197+
"jSj-HB-T2t.title" = "Änderung für alle Monitore";
198198

199199
/* Class = "NSTextFieldCell"; title = "Note: you can press Shift during startup for 'Safe mode' to restore defaults and avoid reading or setting anything."; ObjectID = "Jx2-gO-nq9"; */
200200
"Jx2-gO-nq9.title" = "Hinweis: Du kannst während des Starts die Umschalttaste drücken, um den 'Abgesicherten Modus' zu aktivieren, damit die Standardeinstellungen wiederhergestellt werden und nichts gelesen oder eingestellt wird.";
201201

202202
/* Class = "NSButtonCell"; title = "Enable for Apple branded and built-in displays as well"; ObjectID = "K6A-4z-1aQ"; */
203203
"K6A-4z-1aQ.title" = "Auch für Apple und eingebaute Monitore aktivieren";
204204

205+
/* Class = "NSTextFieldCell"; title = "Screen to control:"; ObjectID = "Kfj-WK-aSL"; */
206+
"Kfj-WK-aSL.title" = "Screen to control:";
207+
205208
/* Class = "NSTextFieldCell"; title = "Don't use software dimming as fallback if no hardware control is available."; ObjectID = "kgh-b4-gmO"; */
206209
"kgh-b4-gmO.title" = "Softwaredimmung nicht als Ausweichlösung verwendet werden, wenn keine Hardware-Steuerung verfügbar ist.";
207210

211+
/* Class = "NSMenuItem"; title = "Depends on mouse pointer position"; ObjectID = "km4-hK-auM"; */
212+
"km4-hK-auM.title" = "Abhängig von der Mauszeigerposition";
213+
208214
/* Class = "NSMenuItem"; title = "Use combined slider for all displays"; ObjectID = "lA0-tv-qRs"; */
209215
"lA0-tv-qRs.title" = "Kombinierten Regler für alle Monitore verwenden";
210216

@@ -223,9 +229,6 @@
223229
/* Class = "NSMenuItem"; title = "Always show in the menu bar"; ObjectID = "MM0-Lf-VgF"; */
224230
"MM0-Lf-VgF.title" = "Immer in der Menüleiste anzeigen";
225231

226-
/* Class = "NSButtonCell"; title = "Use window focus to determine which display to control"; ObjectID = "mMG-Ac-gdB"; */
227-
"mMG-Ac-gdB.title" = "Verwende den Fensterfokus, um den zu steuernden Monitor zu bestimmen";
228-
229232
/* Class = "NSTextFieldCell"; title = "Contrast:"; ObjectID = "MMk-S2-yJN"; */
230233
"MMk-S2-yJN.title" = "Kontrast:";
231234

@@ -241,12 +244,6 @@
241244
/* Class = "NSButtonCell"; title = "Separate scales for combined hardware & software dimming"; ObjectID = "O8o-hI-8eR"; */
242245
"O8o-hI-8eR.title" = "Getrennte Skalen für kombiniertes Dimmen von Hardware und Software";
243246

244-
/* Class = "NSButtonCell"; title = "Use audio device name to determine which display to control"; ObjectID = "OAa-B4-8r3"; */
245-
"OAa-B4-8r3.title" = "Verwenden des Namens des Audiogeräts, um zu bestimmen, welcher Monitor gesteuert werden soll";
246-
247-
/* Class = "NSSlider"; ibExternalAccessibilityDescription = "Brightness"; ObjectID = "OG9-iA-jK1"; */
248-
"OG9-iA-jK1.ibExternalAccessibilityDescription" = "Helligkeit";
249-
250247
/* Class = "NSMenuItem"; title = "Disable keyboard"; ObjectID = "oHf-Gh-68c"; */
251248
"oHf-Gh-68c.title" = "Tastatur deaktivieren";
252249

@@ -301,9 +298,6 @@
301298
/* Class = "NSMenuItem"; title = "Normal"; ObjectID = "Riq-uM-bTs"; */
302299
"Riq-uM-bTs.title" = "Normal";
303300

304-
/* Class = "NSButton"; ibExternalAccessibilityDescription = "Brightness"; ObjectID = "RkH-7d-KvR"; */
305-
"RkH-7d-KvR.ibExternalAccessibilityDescription" = "Helligkeit";
306-
307301
/* Class = "NSButtonCell"; title = "Show advanced settings"; ObjectID = "sAR-sh-y8e"; */
308302
"sAR-sh-y8e.title" = "Erweiterte Einstellungen anzeigen";
309303

@@ -319,9 +313,6 @@
319313
/* Class = "NSTextFieldCell"; title = "Works if an audio device is selected with no native volume control."; ObjectID = "uF5-a9-Ngz"; */
320314
"uF5-a9-Ngz.title" = "Funktioniert, wenn ein Audiogerät ohne eigene Lautstärkesteuerung ausgewählt ist.";
321315

322-
/* Class = "NSTextField"; ibExternalAccessibilityDescription = "Brightness"; ObjectID = "uJS-s3-Zpi"; */
323-
"uJS-s3-Zpi.ibExternalAccessibilityDescription" = "Helligkeit";
324-
325316
/* Class = "NSButtonCell"; title = "Enable keyboard control for display"; ObjectID = "UqR-WE-jHl"; */
326317
"UqR-WE-jHl.title" = "Tastatursteuerung für den Monitor verwenden";
327318

@@ -352,8 +343,8 @@
352343
/* Class = "NSTextFieldCell"; title = "Display advanced settings and additional information in Preferences."; ObjectID = "X6w-Ee-9Jq"; */
353344
"X6w-Ee-9Jq.title" = "Erweiterte Einstellungen und zusätzliche Informationen in den Einstellungen anzeigen.";
354345

355-
/* Class = "NSTextField"; ibExternalAccessibilityDescription = "Brightness"; ObjectID = "xDF-IA-bBh"; */
356-
"xDF-IA-bBh.ibExternalAccessibilityDescription" = "Helligkeit";
346+
/* Class = "NSMenuItem"; title = "Change volume for all screens"; ObjectID = "Xih-P5-NyM"; */
347+
"Xih-P5-NyM.title" = "Lautstärke für alle Monitore ändern";
357348

358349
/* Class = "NSTextFieldCell"; title = "Update settings from the display. May not work with some hardware."; ObjectID = "xjq-hs-wWB"; */
359350
"xjq-hs-wWB.title" = "Aktualisiere die Einstellungen vom Monitor. Funktioniert bei manchen Geräten möglicherweise nicht.";
@@ -379,6 +370,9 @@
379370
/* Class = "NSTextFieldCell"; title = "Identifier:"; ObjectID = "YqZ-LS-YvR"; */
380371
"YqZ-LS-YvR.title" = "Bezeichnung:";
381372

373+
/* Class = "NSMenuItem"; title = "Depends on mouse pointer position"; ObjectID = "Ytd-mg-N5E"; */
374+
"Ytd-mg-N5E.title" = "Abhängig von der Mauszeigerposition";
375+
382376
/* Class = "NSButtonCell"; title = "Use hardware DDC control"; ObjectID = "ZdU-gV-V05"; */
383377
"ZdU-gV-V05.title" = "Hardware DDC Steuerung verwenden";
384378

0 commit comments

Comments
 (0)