Skip to content

Commit 69c044f

Browse files
committed
Fix broken empty configuration window
1 parent f1921a3 commit 69c044f

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

App/Sources/UI/Releases/Release3_25_1.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ private struct ChangesView: View {
138138
text: "The application now automatically creates a backup of the configuration file when then new update is first launched.\n It is stord in **~/.config/keyboardcowboy/backups**.",
139139
version: .v3254),
140140

141+
Change(icon: { KeyboardIconView("M", size: 24).anyView },
142+
text: "Fixes a bug where the initial wizard window wasn't properly set up. [#572](https://github.com/zenangst/KeyboardCowboy/issues/572)",
143+
version: .v3254),
144+
141145
Change(icon: { BugFixIconView(size: 24).anyView },
142146
text: "Fixes a bug where url commands couldn't be updated. [#568](https://github.com/zenangst/KeyboardCowboy/issues/568)",
143147
version: .v3254),

App/Sources/UI/Views/EmptyConfigurationView.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct EmptyConfigurationView: View {
2424
Text("Choose your configuration")
2525
.font(.title)
2626
.frame(maxWidth: .infinity, alignment: .center)
27-
.padding(32)
27+
.padding(16)
2828

2929
Divider()
3030

@@ -81,7 +81,7 @@ struct EmptyConfigurationView: View {
8181
.font(.title3)
8282
.frame(maxWidth: .infinity, alignment: .center)
8383
.padding(.vertical, 8)
84-
.padding(.horizontal, 64)
84+
.padding(.horizontal, 32)
8585

8686

8787
Button(action: {
@@ -93,7 +93,8 @@ struct EmptyConfigurationView: View {
9393
.padding(.vertical)
9494
.matchedGeometryEffect(id: "initial-item", in: namespace)
9595
}
96-
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .leading)
96+
.roundedContainer(padding: 0)
97+
.frame(maxWidth: .infinity, minHeight: 480, maxHeight: .infinity, alignment: .leading)
9798
.background(SplashView(colors: colors, done: $done))
9899
}
99100
}

App/Sources/UI/Windows/EmptyConfiguration.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,22 @@ final class EmptyConfiguration: NSObject, NSWindowDelegate {
1717
.closable,
1818
.miniaturizable,
1919
.resizable,
20+
.titled,
2021
.fullSizeContentView
2122
]
2223
let window = ZenSwiftUIWindow(styleMask: styleMask, content: content)
23-
window.titleVisibility = .hidden
24+
let size = window.hostingController.sizeThatFits(in: .zero)
25+
window.setFrame(NSRect(origin: .zero, size: size), display: false)
26+
window.titleVisibility = .visible
2427
window.titlebarAppearsTransparent = true
28+
window.toolbarStyle = .unifiedCompact
2529
window.orderFrontRegardless()
2630
window.center()
2731
window.delegate = self
2832
self.window = window
2933
}
34+
35+
func windowWillClose(_ notification: Notification) {
36+
self.window = nil
37+
}
3038
}

0 commit comments

Comments
 (0)