Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Clean up Settings layout
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Apr 24, 2024
1 parent 872fdaa commit 77accfe
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 7 deletions.
1 change: 1 addition & 0 deletions Aware/macOS/MenuBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<Void, Never>(priority: .background) {
Expand Down
36 changes: 29 additions & 7 deletions Aware/macOS/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<Bool> {
Expand Down

0 comments on commit 77accfe

Please sign in to comment.