Skip to content

Commit c364703

Browse files
committed
Move detach/attach button to the right side
1 parent 7cab434 commit c364703

2 files changed

Lines changed: 21 additions & 21 deletions

File tree

Core/Sources/SuggestionWidget/ChatWindowView.swift

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct ChatWindowView: View {
3030
) { viewStore in
3131
VStack(spacing: 0) {
3232
Rectangle().fill(.regularMaterial).frame(height: 28)
33-
33+
3434
Divider()
3535

3636
ChatTabBar(store: store)
@@ -58,24 +58,6 @@ struct ChatTitleBar: View {
5858

5959
var body: some View {
6060
HStack(spacing: 6) {
61-
WithViewStore(store, observe: { $0.chatPanelInASeparateWindow }) { viewStore in
62-
TrafficLightButton(
63-
isHovering: isHovering,
64-
isActive: viewStore.state,
65-
color: Color(nsColor: .systemCyan),
66-
action: {
67-
store.send(.toggleChatPanelDetachedButtonClicked)
68-
}
69-
) {
70-
Image(systemName: "pin.fill")
71-
.foregroundStyle(.black.opacity(0.5))
72-
.font(Font.system(size: 6).weight(.black))
73-
.transformEffect(.init(translationX: 0, y: 0.5))
74-
}
75-
}
76-
77-
Spacer()
78-
7961
Button(action: {
8062
store.send(.closeActiveTabClicked)
8163
}) {
@@ -95,9 +77,27 @@ struct ChatTitleBar: View {
9577
}
9678
.opacity(0)
9779
.keyboardShortcut("m", modifiers: [.command])
80+
81+
Spacer()
82+
83+
WithViewStore(store, observe: { $0.chatPanelInASeparateWindow }) { viewStore in
84+
TrafficLightButton(
85+
isHovering: isHovering,
86+
isActive: viewStore.state,
87+
color: Color(nsColor: .systemCyan),
88+
action: {
89+
store.send(.toggleChatPanelDetachedButtonClicked)
90+
}
91+
) {
92+
Image(systemName: "pin.fill")
93+
.foregroundStyle(.black.opacity(0.5))
94+
.font(Font.system(size: 6).weight(.black))
95+
.transformEffect(.init(translationX: 0, y: 0.5))
96+
}
97+
}
9898
}
9999
.buttonStyle(.plain)
100-
.padding(.leading, 2)
100+
.padding(.trailing, 8)
101101
.onHover(perform: { hovering in
102102
isHovering = hovering
103103
})

Core/Sources/SuggestionWidget/SuggestionWidgetController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public final class SuggestionWidgetController: NSObject {
138138
)))
139139
controller.view = view
140140
view.frame = .init(x: 0, y: 0, width: 100, height: 40)
141-
controller.layoutAttribute = .left
141+
controller.layoutAttribute = .right
142142
return controller
143143
}())
144144
it.titlebarAppearsTransparent = true

0 commit comments

Comments
 (0)