Skip to content

Commit eb98e83

Browse files
committed
Update layout for settings views
1 parent 172b9c8 commit eb98e83

File tree

6 files changed

+30
-18
lines changed

6 files changed

+30
-18
lines changed

App/Sources/UI/Views/Onboarding/PermissionsView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ struct PermissionsView: View {
6565
done.toggle()
6666
onAction(.requestPermissions)
6767
})
68+
.buttonStyle(.positive)
6869
.environment(\.buttonBackgroundColor, .systemGreen)
6970
.environment(\.buttonHoverEffect, false)
7071
.environment(\.buttonFocusEffect, false)

App/Sources/UI/Views/Settings/Applications/ApplicationSettingsView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ struct ApplicationSettingsView: View {
1717
.style(.derived)
1818
Spacer()
1919
}
20+
.padding(.top, 8)
2021

2122
Group {
2223
if additionalApplicationPaths.isEmpty {
@@ -38,7 +39,7 @@ struct ApplicationSettingsView: View {
3839
}
3940
Divider()
4041
}
41-
// .style(.item)
42+
.style(.item)
4243
}
4344
.frame(maxHeight: .infinity)
4445
}

App/Sources/UI/Views/Settings/Notifications/NotificationsSettingsView.swift

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ struct NotificationsSettingsView: View {
1010
@AppStorage("Notifications.Placement") var notificationPlacement: NotificationPlacement = .bottomTrailing
1111

1212
var body: some View {
13-
VStack(alignment: .center) {
14-
VStack {
13+
VStack(alignment: .center, spacing: 8) {
14+
VStack(spacing: 8) {
1515
RoundedRectangle(cornerRadius: 4)
1616
.fill(gradient)
1717
.aspectRatio(1.54/1, contentMode: .fit)
18-
.frame(height: 170)
18+
.frame(height: 180)
1919
.overlay(content: {
2020
Text("Notification Placement")
2121
.font(.caption2)
@@ -26,78 +26,84 @@ struct NotificationsSettingsView: View {
2626
}, set: { _ in
2727
notificationPlacement = .topLeading
2828
}), label: {})
29+
.padding(8)
2930
}
3031
.overlay(alignment: .top) {
3132
Toggle(isOn: Binding(get: {
3233
notificationPlacement == .top
3334
}, set: { _ in
3435
notificationPlacement = .top
3536
}), label: {})
37+
.padding(8)
3638
}
3739
.overlay(alignment: .topTrailing) {
3840
Toggle(isOn: Binding(get: {
3941
notificationPlacement == .topTrailing
4042
}, set: { _ in
4143
notificationPlacement = .topTrailing
4244
}), label: {})
45+
.padding(8)
4346
}
44-
4547
.overlay(alignment: .leading) {
4648
Toggle(isOn: Binding(get: {
4749
notificationPlacement == .leading
4850
}, set: { _ in
4951
notificationPlacement = .leading
5052
}), label: {})
53+
.padding(8)
5154
}
52-
5355
.overlay(alignment: .trailing) {
5456
Toggle(isOn: Binding(get: {
5557
notificationPlacement == .trailing
5658
}, set: { _ in
5759
notificationPlacement = .trailing
5860
}), label: {})
61+
.padding(8)
5962
}
60-
6163
.overlay(alignment: .bottomLeading) {
6264
Toggle(isOn: Binding(get: {
6365
notificationPlacement == .bottomLeading
6466
}, set: { _ in
6567
notificationPlacement = .bottomLeading
6668
}), label: {})
69+
.padding(8)
6770
}
68-
6971
.overlay(alignment: .bottom) {
7072
Toggle(isOn: Binding(get: {
7173
notificationPlacement == .bottom
7274
}, set: { _ in
7375
notificationPlacement = .bottom
7476
}), label: {})
77+
.padding(8)
7578
}
76-
7779
.overlay(alignment: .bottomTrailing) {
7880
Toggle(isOn: Binding(get: {
7981
notificationPlacement == .bottomTrailing
8082
}, set: { _ in
8183
notificationPlacement = .bottomTrailing
8284
}), label: {})
83-
.padding(8)
85+
.padding(8)
8486
}
8587
}
88+
.padding(.vertical, 8)
8689
.frame(maxWidth: .infinity)
87-
.padding()
88-
.roundedStyle(padding: 0)
90+
.roundedStyle(padding: 4)
91+
.style(.derived)
8992

9093
Grid(alignment: .leading) {
9194
GridRow {
9295
Toggle("Keyboard Commands", isOn: $keyboardCommands)
9396
Toggle("Running Workflows", isOn: $runningWorkflows)
9497
Toggle("Show Bundles", isOn: $bundles)
9598
}
99+
.frame(maxWidth: .infinity)
96100
}
101+
.switchStyle()
97102
.font(.caption2)
98-
.padding([.horizontal])
103+
.roundedSubStyle()
104+
.style(.derived)
99105
}
100-
.frame(minWidth: 480, minHeight: 280, alignment: .top)
106+
.style(.derived)
101107
.enableInjection()
102108
}
103109

App/Sources/UI/Views/Settings/Permissions/PermissionsSettingsView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ struct PermissionsSettingsView: View {
3737
}
3838
}
3939
})
40-
.frame(minWidth: 480, maxWidth: 480)
4140
}
4241
}
4342

App/Sources/UI/Views/Settings/SettingsView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ struct SettingsView: View {
1010
NotificationsSettingsView()
1111
.tabItem { Label("Notifications", systemImage: "app.badge") }
1212
PermissionsSettingsView()
13+
.padding(8)
1314
.tabItem { Label("Permissions", systemImage: "hand.raised.circle.fill") }
1415
}
16+
.frame(minWidth: 450, minHeight: 280, alignment: .center)
1517
.enableInjection()
1618
}
1719
}

App/Sources/UI/Windows/PermissionsSettings.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ final class PermissionsSettings: NSObject, NSWindowDelegate {
66
private var window: NSWindow?
77

88
func show() {
9-
let styleMask: NSWindow.StyleMask = [.closable, .miniaturizable, .resizable, .titled]
10-
let window = ZenSwiftUIWindow(styleMask: styleMask,
11-
content: PermissionsSettingsView().style(.derived))
9+
let styleMask: NSWindow.StyleMask = [.closable, .miniaturizable, .resizable, .titled, .fullSizeContentView]
10+
let window = ZenSwiftUIWindow(styleMask: styleMask) {
11+
PermissionsSettingsView()
12+
.style(.derived)
13+
.frame(minWidth: 400)
14+
}
1215
window.animationBehavior = .utilityWindow
1316
window.titleVisibility = .hidden
1417
window.titlebarAppearsTransparent = true

0 commit comments

Comments
 (0)