Skip to content

Commit 8630ed6

Browse files
committed
fix: prevent shortcut hints overflow in welcome window footer
1 parent b1ebc9a commit 8630ed6

1 file changed

Lines changed: 18 additions & 7 deletions

File tree

TablePro/Views/Connection/WelcomeWindowView.swift

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,23 @@ struct WelcomeWindowView: View {
240240
Spacer()
241241

242242
// Footer hints
243-
HStack(spacing: 16) {
244-
SyncStatusIndicator()
245-
KeyboardHint(keys: "", label: "Connect")
246-
KeyboardHint(keys: "⌘N", label: "New")
247-
KeyboardHint(keys: "⌘,", label: "Settings")
243+
ViewThatFits(in: .horizontal) {
244+
HStack(spacing: 12) {
245+
SyncStatusIndicator()
246+
KeyboardHint(keys: "", label: "Connect")
247+
KeyboardHint(keys: "⌘N", label: "New")
248+
KeyboardHint(keys: "⌘,", label: "Settings")
249+
}
250+
HStack(spacing: 8) {
251+
SyncStatusIndicator()
252+
KeyboardHint(keys: "", label: "Connect")
253+
KeyboardHint(keys: "⌘N", label: "New")
254+
KeyboardHint(keys: "⌘,", label: nil)
255+
}
248256
}
249257
.font(.system(size: ThemeEngine.shared.activeTheme.typography.small))
250258
.foregroundStyle(.tertiary)
259+
.padding(.horizontal, ThemeEngine.shared.activeTheme.spacing.sm)
251260
.padding(.bottom, ThemeEngine.shared.activeTheme.spacing.lg)
252261
}
253262
.frame(width: 260)
@@ -1103,7 +1112,7 @@ private struct WelcomeButtonStyle: ButtonStyle {
11031112

11041113
private struct KeyboardHint: View {
11051114
let keys: String
1106-
let label: String
1115+
let label: String?
11071116

11081117
var body: some View {
11091118
HStack(spacing: 4) {
@@ -1115,7 +1124,9 @@ private struct KeyboardHint: View {
11151124
RoundedRectangle(cornerRadius: 3)
11161125
.fill(Color(nsColor: .quaternaryLabelColor))
11171126
)
1118-
Text(label)
1127+
if let label {
1128+
Text(label)
1129+
}
11191130
}
11201131
}
11211132
}

0 commit comments

Comments
 (0)