Skip to content

Commit 7cab434

Browse files
committed
Adjust style of chat window
1 parent 56151df commit 7cab434

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

Core/Sources/SuggestionWidget/ChatWindowView.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ struct ChatWindowView: View {
2929
}
3030
) { viewStore in
3131
VStack(spacing: 0) {
32+
Rectangle().fill(.regularMaterial).frame(height: 28)
33+
34+
Divider()
35+
3236
ChatTabBar(store: store)
3337
.frame(height: 26)
3438

@@ -37,6 +41,8 @@ struct ChatWindowView: View {
3741
ChatTabContainer(store: store)
3842
.frame(maxWidth: .infinity, maxHeight: .infinity)
3943
}
44+
.xcodeStyleFrame(cornerRadius: 10)
45+
.ignoresSafeArea(edges: .top)
4046
.background(.regularMaterial)
4147
.onChange(of: viewStore.state.isPanelDisplayed) { isDisplayed in
4248
toggleVisibility(isDisplayed)
@@ -69,7 +75,7 @@ struct ChatTitleBar: View {
6975
}
7076

7177
Spacer()
72-
78+
7379
Button(action: {
7480
store.send(.closeActiveTabClicked)
7581
}) {

Core/Sources/SuggestionWidget/Styles.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ extension NSAppearance {
4646
}
4747

4848
extension View {
49-
func xcodeStyleFrame() -> some View {
50-
clipShape(RoundedRectangle(cornerRadius: 8, style: .continuous))
49+
func xcodeStyleFrame(cornerRadius: Double = 8) -> some View {
50+
clipShape(RoundedRectangle(cornerRadius: cornerRadius, style: .continuous))
5151
.overlay(
52-
RoundedRectangle(cornerRadius: 8, style: .continuous)
52+
RoundedRectangle(cornerRadius: cornerRadius, style: .continuous)
5353
.stroke(Color.black.opacity(0.3), style: .init(lineWidth: 1))
5454
)
5555
.overlay(
56-
RoundedRectangle(cornerRadius: 7, style: .continuous)
56+
RoundedRectangle(cornerRadius: max(0, cornerRadius - 1), style: .continuous)
5757
.stroke(Color.white.opacity(0.2), style: .init(lineWidth: 1))
5858
.padding(1)
5959
)

Core/Sources/SuggestionWidget/SuggestionWidgetController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public final class SuggestionWidgetController: NSObject {
122122
private lazy var chatPanelWindow = {
123123
let it = ChatWindow(
124124
contentRect: .zero,
125-
styleMask: [.resizable, .titled, .miniaturizable],
125+
styleMask: [.resizable, .titled, .miniaturizable, .fullSizeContentView],
126126
backing: .buffered,
127127
defer: false
128128
)
@@ -141,6 +141,7 @@ public final class SuggestionWidgetController: NSObject {
141141
controller.layoutAttribute = .left
142142
return controller
143143
}())
144+
it.titlebarAppearsTransparent = true
144145
it.isReleasedWhenClosed = false
145146
it.isOpaque = false
146147
it.backgroundColor = .clear
@@ -150,7 +151,6 @@ public final class SuggestionWidgetController: NSObject {
150151
.transient,
151152
.fullScreenPrimary,
152153
.fullScreenAllowsTiling,
153-
if #available(macOS 13, *) { [.primary] },
154154
]
155155
it.hasShadow = true
156156
it.contentView = NSHostingView(

0 commit comments

Comments
 (0)