From 77accfec8719703f5fbb59543b08c9fe54652821 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Tue, 23 Apr 2024 19:28:50 -0700 Subject: [PATCH] Clean up Settings layout --- Aware/macOS/MenuBar.swift | 1 + Aware/macOS/SettingsView.swift | 36 +++++++++++++++++++++++++++------- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/Aware/macOS/MenuBar.swift b/Aware/macOS/MenuBar.swift index 477c2e6..31c1b54 100644 --- a/Aware/macOS/MenuBar.swift +++ b/Aware/macOS/MenuBar.swift @@ -89,6 +89,7 @@ private func findStatusBarItem() -> NSStatusItem? { struct MenuBarContentView: View { var body: some View { SettingsLink() + .keyboardShortcut(",") // FIXME: Remove before next release Button("Export Logs") { Task(priority: .background) { diff --git a/Aware/macOS/SettingsView.swift b/Aware/macOS/SettingsView.swift index 2c231b5..92375d3 100644 --- a/Aware/macOS/SettingsView.swift +++ b/Aware/macOS/SettingsView.swift @@ -18,27 +18,49 @@ struct SettingsView: View { var body: some View { Form { - Section(header: Text("Timer")) { - Picker("Format Style", selection: $timerFormatStyle) { + Section { + Picker("Format Style:", selection: $timerFormatStyle) { ForEach(TimerFormatStyle.Style.allCases, id: \.self) { style in Text(style.exampleText) } } Toggle("Show Seconds", isOn: $showSeconds) + } - TextField(value: $userIdleSeconds, format: .number) { - Text("Idle Seconds") - } + Spacer() + .frame(width: 0, height: 0) + .padding(.top) - Toggle("Open at Login", isOn: openAtLogin) - .toggleStyle(.checkbox) + Section { + LabeledContent("Reset after:") { + TextField("Idle Seconds", value: $userIdleSeconds, format: .number) + .multilineTextAlignment(.trailing) + .labelsHidden() + .frame(width: 50) + Stepper("Idle Seconds", value: $userIdleSeconds, step: 30) + .labelsHidden() + Text("seconds of inactivity") + .padding(.leading, 5) + } Button("Reset Timer") { self.resetTimer = true } } + + Spacer() + .frame(width: 0, height: 0) + .padding(.top) + + Section { + LabeledContent("Login Item:") { + Toggle("Open at Login", isOn: openAtLogin) + } + } } + .padding() + .frame(width: 350) } var openAtLogin: Binding {