feat: moved widgets settings to the new design

This commit is contained in:
Serhiy Mytrovtsiy
2024-04-25 18:04:19 +02:00
parent f873fdaa3d
commit bfadf4eb9b
14 changed files with 247 additions and 301 deletions

View File

@@ -231,26 +231,24 @@ public class StackWidget: WidgetWrapper {
public override func settings() -> NSView {
let view = SettingsContainerView()
view.addArrangedSubview(selectSettingsRow(
title: localizedString("Display mode"),
action: #selector(self.changeDisplayMode),
items: SensorsWidgetMode,
selected: self.modeState.rawValue
))
var rows = [
PreferencesRow(localizedString("Display mode"), component: selectView(
action: #selector(self.changeDisplayMode),
items: SensorsWidgetMode,
selected: self.modeState.rawValue
)),
PreferencesRow(localizedString("Monospaced font"), component: switchView(
action: #selector(self.toggleMonospacedFont),
state: self.monospacedFontState
))
]
if self.title != "Clock" {
view.addArrangedSubview(toggleSettingRow(
title: localizedString("Static width"),
rows.append(PreferencesRow(localizedString("Static width"), component: switchView(
action: #selector(self.toggleSize),
state: self.fixedSizeState
))
)))
}
view.addArrangedSubview(toggleSettingRow(
title: localizedString("Monospaced font"),
action: #selector(self.toggleMonospacedFont),
state: self.monospacedFontState
))
view.addArrangedSubview(PreferencesSection(rows))
view.addArrangedSubview(self.orderTableView)