Skip to content

Commit

Permalink
Revert parts of "Simplify options in settings"
Browse files Browse the repository at this point in the history
This reverts back to using the "Smart" rehide strategy name
  • Loading branch information
jordanbaird committed Jul 20, 2024
1 parent 39b1267 commit 4acaff4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions Ice/Events/EventManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class EventManager {
switch event.type {
case .leftMouseDown:
handleShowOnClick()
handleDefaultRehide(with: event)
handleSmartRehide(with: event)
case .rightMouseDown:
handleShowRightClickMenu()
default:
Expand Down Expand Up @@ -161,13 +161,13 @@ extension EventManager {
}
}

// MARK: Handle Default Rehide
// MARK: Handle Smart Rehide

private func handleDefaultRehide(with event: NSEvent) {
private func handleSmartRehide(with event: NSEvent) {
guard
let appState,
appState.settingsManager.generalSettingsManager.autoRehide,
case .default = appState.settingsManager.generalSettingsManager.rehideStrategy
case .smart = appState.settingsManager.generalSettingsManager.rehideStrategy
else {
return
}
Expand Down
6 changes: 3 additions & 3 deletions Ice/MenuBar/RehideStrategy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import SwiftUI

/// A type that determines how the auto-rehide feature works.
enum RehideStrategy: Int, CaseIterable, Identifiable {
/// Menu bar items are rehidden using the default algorithm.
case `default` = 0
/// Menu bar items are rehidden using a smart algorithm.
case smart = 0
/// Menu bar items are rehidden after a given time interval.
case timed = 1
/// Menu bar items are rehidden when the focused app changes.
Expand All @@ -19,7 +19,7 @@ enum RehideStrategy: Int, CaseIterable, Identifiable {
/// Localized string key representation.
var localized: LocalizedStringKey {
switch self {
case .default: "Default"
case .smart: "Smart"
case .timed: "Timed"
case .focusedApp: "Focused app"
}
Expand Down
2 changes: 1 addition & 1 deletion Ice/Settings/SettingsManagers/GeneralSettingsManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ final class GeneralSettingsManager: ObservableObject {
@Published var autoRehide = true

/// A strategy that determines how the auto-rehide feature works.
@Published var rehideStrategy: RehideStrategy = .default
@Published var rehideStrategy: RehideStrategy = .smart

/// A time interval for the auto-rehide feature when its rule
/// is ``RehideStrategy/timed``.
Expand Down
4 changes: 2 additions & 2 deletions Ice/Settings/SettingsPanes/GeneralSettingsPane.swift
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ struct GeneralSettingsPane: View {
} label: {
Text("Strategy")
switch manager.rehideStrategy {
case .default:
Text("Menu bar items are rehidden using the default algorithm")
case .smart:
Text("Menu bar items are rehidden using a smart algorithm")
case .timed:
Text("Menu bar items are rehidden after a fixed amount of time")
case .focusedApp:
Expand Down

0 comments on commit 4acaff4

Please sign in to comment.