feat: add preference: display the ui on screen including menu bar

This commit is contained in:
Daniel Montesinos authored and lwouis committed 2020-04-20 01:49:25 +09:00
1 parent 6be1c2ccca
commit 156957c376
2 files changed
+6 -3

No files matched your search

+2
View File
@@ -196,11 +196,13 @@ enum ScreensToShowPreference: String, CaseIterable, MacroPreference {
enum ShowOnScreenPreference: String, CaseIterable, MacroPreference {
case active = "Active screen"
case includingMouse = "Screen including mouse"
case includingMenubar = "Screen including menu bar"
var localizedString: LocalizedString {
switch self {
case .active: return NSLocalizedString("Active screen", comment: "")
case .includingMouse: return NSLocalizedString("Screen including mouse", comment: "")
case .includingMenubar: return NSLocalizedString("Screen including menu bar", comment: "")
}
}
}
+4 -3
View File
@@ -3,8 +3,9 @@ import Cocoa
class Screen {
static func preferred() -> NSScreen {
switch Preferences.showOnScreen {
case .includingMouse: return withMouse() ?? NSScreen.main!; // .main as fall-back
case .active: return NSScreen.main!;
case .includingMouse: return withMouse() ?? NSScreen.main! // .main as fall-back
case .active: return NSScreen.main!
case .includingMenubar: return NSScreen.screens.first!
}
}
@@ -33,4 +34,4 @@ enum VerticalAlignment: CGFloat {
case appleCentered = 0.75
}
typealias ScreenUuid = CFString
typealias ScreenUuid = CFString