Skip to content

Commit 480f7ba

Browse files
committed
Add shortcut command+w to close chat
1 parent ef67329 commit 480f7ba

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

Core/Sources/SuggestionWidget/SuggestionPanelContent/ChatPanel.swift

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,6 @@ struct ChatPanelToolbar: View {
3333

3434
var body: some View {
3535
HStack {
36-
Toggle(isOn: .init(get: {
37-
useGlobalChat
38-
}, set: { _ in
39-
chat.switchContext()
40-
})) { EmptyView() }
41-
.toggleStyle(GlobalChatSwitchToggleStyle())
42-
43-
Spacer()
44-
4536
Button(action: {
4637
chat.close()
4738
}) {
@@ -50,9 +41,19 @@ struct ChatPanelToolbar: View {
5041
.foregroundStyle(.secondary)
5142
}
5243
.buttonStyle(.plain)
44+
.keyboardShortcut("w", modifiers: [.command])
45+
46+
Spacer()
47+
48+
Toggle(isOn: .init(get: {
49+
useGlobalChat
50+
}, set: { _ in
51+
chat.switchContext()
52+
})) { EmptyView() }
53+
.toggleStyle(GlobalChatSwitchToggleStyle())
5354
}
54-
.padding(.leading, 8)
55-
.padding(.trailing, 4)
55+
.padding(.leading, 4)
56+
.padding(.trailing, 8)
5657
.padding(.vertical, 4)
5758
.background(.regularMaterial)
5859
}

0 commit comments

Comments
 (0)