mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
feat: changed the default value of macOS widgets to disabled to prevent heavy load on some systems, and added information text to the widgets (#2733)
This commit is contained in:
@@ -40,8 +40,14 @@ class ApplicationSettings: NSStackView {
|
||||
}
|
||||
|
||||
private var systemWidgetsUpdatesState: Bool {
|
||||
get { Store.shared.bool(key: "systemWidgetsUpdates_state", defaultValue: true) }
|
||||
set { Store.shared.set(key: "systemWidgetsUpdates_state", value: newValue) }
|
||||
get {
|
||||
let userDefaults = UserDefaults(suiteName: "\(Bundle.main.object(forInfoDictionaryKey: "TeamId") as! String).eu.exelban.Stats.widgets")
|
||||
return userDefaults?.bool(forKey: "systemWidgetsUpdates_state") ?? false
|
||||
}
|
||||
set {
|
||||
let userDefaults = UserDefaults(suiteName: "\(Bundle.main.object(forInfoDictionaryKey: "TeamId") as! String).eu.exelban.Stats.widgets")
|
||||
userDefaults?.set(newValue, forKey: "systemWidgetsUpdates_state")
|
||||
}
|
||||
}
|
||||
|
||||
private var updateSelector: NSPopUpButton?
|
||||
@@ -103,7 +109,7 @@ class ApplicationSettings: NSStackView {
|
||||
]))
|
||||
|
||||
scrollView.stackView.addArrangedSubview(PreferencesSection([
|
||||
PreferencesRow(localizedString("System widgets updates"), component: switchView(
|
||||
PreferencesRow(localizedString("macOS widgets"), component: switchView(
|
||||
action: #selector(self.toggleSystemWidgetsUpdatesState),
|
||||
state: self.systemWidgetsUpdatesState
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user