diff --git a/Sources/Luminare/Main Window/LuminarePane.swift b/Sources/Luminare/Main Window/LuminarePane.swift index d18795a..291a577 100644 --- a/Sources/Luminare/Main Window/LuminarePane.swift +++ b/Sources/Luminare/Main Window/LuminarePane.swift @@ -61,7 +61,17 @@ public struct LuminarePane: View where Header: View, Content: V // MARK: Body public var body: some View { - ZStack { + VStack(spacing: 0) { + VStack(alignment: .leading, spacing: 0) { + header() + .buttonStyle(TabHeaderButtonStyle()) + .padding(.horizontal, 10) + .padding(.trailing, 5) + .frame(height: titlebarHeight, alignment: .leading) + + Divider() + } + Group { switch layout { case .none: @@ -92,19 +102,8 @@ public struct LuminarePane: View where Header: View, Content: V } .ignoresSafeArea() } - - VStack(alignment: .leading, spacing: 0) { - header() - .buttonStyle(TabHeaderButtonStyle()) - .padding(.horizontal, 10) - .padding(.trailing, 5) - .frame(height: titlebarHeight, alignment: .leading) - - Divider() - } - .frame(maxHeight: .infinity, alignment: .top) - .edgesIgnoringSafeArea(.top) } + .edgesIgnoringSafeArea(.top) .luminareBackground() } } @@ -126,3 +125,64 @@ struct TabHeaderButtonStyle: ButtonStyle { } } } + +// MARK: - Preview + +@available(macOS 15.0, *) +#Preview( + "LuminarePane", + traits: .sizeThatFitsLayout +) { + LuminarePane("Luminare") { + Section("General") { + LuminareToggleCompose( + "Launch at login", + isOn: .constant(true) + ) + + LuminareToggleCompose( + "Hide menu bar icon", + isOn: .constant(true) + ) + + LuminareSliderPickerCompose( + "Animation speed", + ["Instant", "Fast", "Smooth"], + selection: .constant("Fast") + ) { speed in + Text(speed) + .monospaced() + } + } + + Section("Window") { + LuminareButtonCompose( + "Debug", + "Reset Window Frame" + ) {} + + LuminareToggleCompose( + "Restore window frame on drag", + isOn: .constant(true) + ) + + LuminareToggleCompose( + "Include padding", + isOn: .constant(true) + ) + } + + Section("Cursor") { + LuminareToggleCompose( + "Use screen with cursor", + isOn: .constant(true) + ) + + LuminareToggleCompose( + "Move cursor with window", + isOn: .constant(true) + ) + } + } + .luminarePaneLayout(.form) +} diff --git a/Sources/Luminare/Main Window/Sidebar/LuminareSidebar.swift b/Sources/Luminare/Main Window/Sidebar/LuminareSidebar.swift index 7618f37..b9f6c6d 100644 --- a/Sources/Luminare/Main Window/Sidebar/LuminareSidebar.swift +++ b/Sources/Luminare/Main Window/Sidebar/LuminareSidebar.swift @@ -28,6 +28,7 @@ public struct LuminareSidebar: View where Content: View { VStack(spacing: 24) { content() } + .padding(.bottom, 12) } .scrollIndicators(.never) .scrollContentBackground(.hidden)