feat: preference to hide windows status icons (closes #467)

This commit is contained in:
Louis Pontoise authored and lwouis committed 2020-07-29 00:20:16 +09:00
1 parent 02776f044c
commit d305eb8e8f
3 files changed
+6 -3

No files matched your search

+2
View File
@@ -41,6 +41,7 @@ class Preferences {
"screensToShow2": "0", "screensToShow2": "0",
"fadeOutAnimation": "false", "fadeOutAnimation": "false",
"hideSpaceNumberLabels": "false", "hideSpaceNumberLabels": "false",
"hideStatusIcons": "false",
"startAtLogin": "true", "startAtLogin": "true",
"hideMenubarIcon": "false", "hideMenubarIcon": "false",
"dontShowBlacklist": "", "dontShowBlacklist": "",
@@ -84,6 +85,7 @@ class Preferences {
static var windowDisplayDelay: DispatchTimeInterval { DispatchTimeInterval.milliseconds(defaults.int("windowDisplayDelay")) } static var windowDisplayDelay: DispatchTimeInterval { DispatchTimeInterval.milliseconds(defaults.int("windowDisplayDelay")) }
static var fadeOutAnimation: Bool { defaults.bool("fadeOutAnimation") } static var fadeOutAnimation: Bool { defaults.bool("fadeOutAnimation") }
static var hideSpaceNumberLabels: Bool { defaults.bool("hideSpaceNumberLabels") } static var hideSpaceNumberLabels: Bool { defaults.bool("hideSpaceNumberLabels") }
static var hideStatusIcons: Bool { defaults.bool("hideStatusIcons") }
static var startAtLogin: Bool { defaults.bool("startAtLogin") } static var startAtLogin: Bool { defaults.bool("startAtLogin") }
static var hideMenubarIcon: Bool { defaults.bool("hideMenubarIcon") } static var hideMenubarIcon: Bool { defaults.bool("hideMenubarIcon") }
static var dontShowBlacklist: [String] { blacklistStringToArray(defaults.string("dontShowBlacklist")) } static var dontShowBlacklist: [String] { blacklistStringToArray(defaults.string("dontShowBlacklist")) }
+3 -3
View File
@@ -112,9 +112,9 @@ class ThumbnailView: NSStackView {
// workaround: setting string on NSTextView changes the font (most likely a Cocoa bug) // workaround: setting string on NSTextView changes the font (most likely a Cocoa bug)
label.font = Preferences.font label.font = Preferences.font
} }
assignIfDifferent(&hiddenIcon.isHidden, !element.isHidden) assignIfDifferent(&hiddenIcon.isHidden, !element.isHidden || Preferences.hideStatusIcons)
assignIfDifferent(&fullscreenIcon.isHidden, !element.isFullscreen) assignIfDifferent(&fullscreenIcon.isHidden, !element.isFullscreen || Preferences.hideStatusIcons)
assignIfDifferent(&minimizedIcon.isHidden, !element.isMinimized) assignIfDifferent(&minimizedIcon.isHidden, !element.isMinimized || Preferences.hideStatusIcons)
assignIfDifferent(&spaceIcon.isHidden, Spaces.isSingleSpace || Preferences.hideSpaceNumberLabels) assignIfDifferent(&spaceIcon.isHidden, Spaces.isSingleSpace || Preferences.hideSpaceNumberLabels)
if !spaceIcon.isHidden { if !spaceIcon.isHidden {
if element.isOnAllSpaces { if element.isOnAllSpaces {
@@ -21,6 +21,7 @@ class AppearanceTab: NSViewController, PreferencePane {
LabelAndControl.makeLabelWithSlider(NSLocalizedString("Apparition delay:", comment: ""), "windowDisplayDelay", 0, 2000, 11, false, "ms"), LabelAndControl.makeLabelWithSlider(NSLocalizedString("Apparition delay:", comment: ""), "windowDisplayDelay", 0, 2000, 11, false, "ms"),
LabelAndControl.makeLabelWithCheckbox(NSLocalizedString("Fade out animation:", comment: ""), "fadeOutAnimation", extraAction: { _ in App.app.thumbnailsPanel.updateFadeOutAnimation() }), LabelAndControl.makeLabelWithCheckbox(NSLocalizedString("Fade out animation:", comment: ""), "fadeOutAnimation", extraAction: { _ in App.app.thumbnailsPanel.updateFadeOutAnimation() }),
LabelAndControl.makeLabelWithCheckbox(NSLocalizedString("Hide space number labels:", comment: ""), "hideSpaceNumberLabels"), LabelAndControl.makeLabelWithCheckbox(NSLocalizedString("Hide space number labels:", comment: ""), "hideSpaceNumberLabels"),
LabelAndControl.makeLabelWithCheckbox(NSLocalizedString("Hide status icons:", comment: ""), "hideStatusIcons"),
LabelAndControl.makeLabelWithCheckbox(NSLocalizedString("Show standard tabs as windows:", comment: ""), "showTabsAsWindows"), LabelAndControl.makeLabelWithCheckbox(NSLocalizedString("Show standard tabs as windows:", comment: ""), "showTabsAsWindows"),
LabelAndControl.makeLabelWithCheckbox(NSLocalizedString("Hide colored circles on mouse hover:", comment: ""), "hideColoredCircles"), LabelAndControl.makeLabelWithCheckbox(NSLocalizedString("Hide colored circles on mouse hover:", comment: ""), "hideColoredCircles"),
]) ])