Skip to content

Commit f8c565a

Browse files
committed
Adjust buttons
1 parent a863315 commit f8c565a

File tree

1 file changed

+33
-25
lines changed

1 file changed

+33
-25
lines changed

Core/Sources/SuggestionWidget/ChatWindowView.swift

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -52,53 +52,61 @@ struct ChatWindowView: View {
5252
struct ChatTitleBar: View {
5353
let store: StoreOf<ChatPanelFeature>
5454
@State var isHovering = false
55+
@Environment(\.controlActiveState) var controlActiveState
5556

5657
var body: some View {
5758
HStack(spacing: 4) {
5859
Button(action: {
5960
store.send(.hideButtonClicked)
6061
}) {
6162
Circle()
62-
.fill(Color(nsColor: .systemRed))
63+
.fill(
64+
controlActiveState == .key
65+
? Color(nsColor: .systemOrange)
66+
: Color(nsColor: .disabledControlTextColor)
67+
)
6368
.frame(width: 10, height: 10)
6469
.overlay {
65-
Circle().strokeBorder(.secondary.opacity(0.3), lineWidth: 1)
70+
Circle().strokeBorder(.secondary.opacity(0.2), lineWidth: 1)
6671
}
6772
.overlay {
6873
if isHovering {
69-
Image(systemName: "xmark")
74+
Image(systemName: "minus")
7075
.resizable()
7176
.foregroundStyle(.secondary)
7277
.font(Font.title.weight(.heavy))
73-
.frame(width: 5, height: 5)
78+
.frame(width: 5, height: 1)
7479
}
7580
}
7681
}
77-
82+
7883
WithViewStore(store, observe: { $0.chatPanelInASeparateWindow }) { viewStore in
79-
if viewStore.state {
80-
Button(action: {
81-
store.send(.attachChatPanel)
82-
}) {
83-
Circle()
84-
.fill(.indigo)
85-
.frame(width: 10, height: 10)
86-
.overlay {
87-
Circle().strokeBorder(.secondary.opacity(0.3), lineWidth: 1)
88-
}
89-
.overlay {
90-
if isHovering {
91-
Image(systemName: "pin")
92-
.resizable()
93-
.foregroundStyle(.secondary)
94-
.font(Font.title.weight(.heavy))
95-
.frame(width: 5, height: 5)
96-
}
84+
Button(action: {
85+
store.send(.toggleChatPanelDetachedButtonClicked)
86+
}) {
87+
Circle()
88+
.fill(
89+
controlActiveState == .key && viewStore.state
90+
? Color(nsColor: .systemIndigo)
91+
: Color(nsColor: .disabledControlTextColor)
92+
)
93+
.frame(width: 10, height: 10)
94+
.overlay {
95+
Circle().strokeBorder(.secondary.opacity(0.2), lineWidth: 1)
96+
}
97+
.disabled(!viewStore.state)
98+
.overlay {
99+
if isHovering {
100+
Image(systemName: "pin")
101+
.resizable()
102+
.foregroundStyle(.secondary)
103+
.font(Font.title.weight(.heavy))
104+
.frame(width: 5, height: 5)
97105
}
98-
}
106+
}
99107
}
100108
}
101-
109+
102110
Button(action: {
103111
store.send(.closeActiveTabClicked)
104112
}) {

0 commit comments

Comments
 (0)