Skip to content

Commit

Permalink
🐛 Fix LuminarePane
Browse files Browse the repository at this point in the history
  • Loading branch information
KrLite committed Dec 17, 2024
1 parent 1be0a11 commit 7d687cc
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 13 deletions.
86 changes: 73 additions & 13 deletions Sources/Luminare/Main Window/LuminarePane.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,17 @@ public struct LuminarePane<Header, Content>: 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:
Expand Down Expand Up @@ -92,19 +102,8 @@ public struct LuminarePane<Header, Content>: 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()
}
}
Expand All @@ -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)
}
1 change: 1 addition & 0 deletions Sources/Luminare/Main Window/Sidebar/LuminareSidebar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public struct LuminareSidebar<Content>: View where Content: View {
VStack(spacing: 24) {
content()
}
.padding(.bottom, 12)
}
.scrollIndicators(.never)
.scrollContentBackground(.hidden)
Expand Down

0 comments on commit 7d687cc

Please sign in to comment.