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:
Serhiy Mytrovtsiy
2026-02-14 18:39:49 +01:00
parent 477c733759
commit 52d21619bf
7 changed files with 23 additions and 9 deletions

View File

@@ -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
))