@@ -129,6 +129,18 @@ public final class SuggestionWidgetController: NSObject {
129129 it. minimizeWindow = { [ weak self] in
130130 self ? . store. send ( . chatPanel( . hideButtonClicked) )
131131 }
132+ it. titleVisibility = . hidden
133+ it. addTitlebarAccessoryViewController ( {
134+ let controller = NSTitlebarAccessoryViewController ( )
135+ let view = NSHostingView ( rootView: ChatTitleBar ( store: store. scope (
136+ state: \. chatPanelState,
137+ action: WidgetFeature . Action. chatPanel
138+ ) ) )
139+ controller. view = view
140+ view. frame = . init( x: 0 , y: 0 , width: 100 , height: 40 )
141+ controller. layoutAttribute = . left
142+ return controller
143+ } ( ) )
132144 it. isReleasedWhenClosed = false
133145 it. isOpaque = false
134146 it. backgroundColor = . clear
@@ -138,7 +150,7 @@ public final class SuggestionWidgetController: NSObject {
138150 . transient,
139151 . fullScreenPrimary,
140152 . fullScreenAllowsTiling,
141- if #available( macOS 13 , * ) { [ . primary] }
153+ if #available( macOS 13 , * ) { [ . primary] } ,
142154 ]
143155 it. hasShadow = true
144156 it. contentView = NSHostingView (
@@ -276,21 +288,22 @@ class CanBecomeKeyWindow: NSWindow {
276288class ChatWindow : NSWindow {
277289 override var canBecomeKey : Bool { true }
278290 override var canBecomeMain : Bool { true }
279-
291+
280292 var minimizeWindow : ( ) -> Void = { }
281-
293+
282294 var isWindowHidden : Bool = false {
283295 didSet {
284296 alphaValue = isPanelDisplayed && !isWindowHidden ? 1 : 0
285297 }
286298 }
299+
287300 var isPanelDisplayed : Bool = false {
288301 didSet {
289302 alphaValue = isPanelDisplayed && !isWindowHidden ? 1 : 0
290303 }
291304 }
292-
293- override func miniaturize( _ sender : Any ? ) {
305+
306+ override func miniaturize( _: Any ? ) {
294307 minimizeWindow ( )
295308 }
296309}
0 commit comments