@@ -9,6 +9,7 @@ import Cocoa
99import SnapKit
1010
1111class BoxBaseContainerViewController : NSViewController {
12+ // MARK: - LeftContainer
1213 var splitView : BoxBaseSplitView = BoxBaseSplitView ( )
1314 var contentGroup : BoxContentsViewGroup = BoxContentsViewGroup ( )
1415 var toolbarGroupVC : ToolbarViewController = ToolbarViewController ( )
@@ -17,6 +18,11 @@ class BoxBaseContainerViewController: NSViewController {
1718 let windowViewGroupVC : WindowButtonViewController = WindowButtonViewController ( )
1819 var leftContainer : MovableContainerView = MovableContainerView ( )
1920 var buttonGroupVC : ButtonGroupViewController = ButtonGroupViewController ( )
21+
22+ // MARK: - QuickSlot
23+ var preferenceVC : PreferencesViewController = PreferencesViewController ( )
24+ var scriptsVC : ScriptsViewController = ScriptsViewController ( )
25+
2026 weak var menubarVCDelegate : MenubarViewControllerDelegate ? // extension
2127
2228 override func loadView( ) {
@@ -32,8 +38,11 @@ class BoxBaseContainerViewController: NSViewController {
3238
3339 override func viewDidLoad( ) {
3440 self . view. wantsLayer = true
41+
3542// self.view.layer?.backgroundColor = NSColor(hex: "#FF9548").cgColor
3643 self . view. layer? . backgroundColor = NSColor ( hex: " #E7E7E7 " ) . cgColor
44+
45+ NotificationCenter . default. addObserver ( self , selector: #selector( handleButtonTapped) , name: . collectionButtonTapped, object: nil )
3746 }
3847
3948 func BoxButtonViewGroupInit( ) -> BoxButtonViewGroup {
@@ -171,3 +180,29 @@ extension BoxBaseContainerViewController: BoxFunctionViewControllerDelegate {
171180 clickBtn ( sender: " box " )
172181 }
173182}
183+
184+ extension BoxBaseContainerViewController {
185+ @objc func handleButtonTapped( notification: NSNotification ) {
186+ if let button = notification. object as? NSButton {
187+ if button. title == QuickSlotUI . title. preferences {
188+ print ( " Button with title \( button. title) was tapped in BaseVC " )
189+ contentGroup. showPreferences ( )
190+ }
191+
192+ if button. title == QuickSlotUI . title. scripts {
193+ print ( " Button with title \( button. title) was tapped in BaseVC " )
194+ contentGroup. showScripts ( )
195+ }
196+
197+ if button. title == QuickSlotUI . title. user {
198+ print ( " Button with title \( button. title) was tapped in BaseVC " )
199+ contentGroup. removeAllSubviews ( )
200+ print ( WebViewManager . shared. hostingWebView!)
201+ contentGroup. addSubview ( WebViewManager . shared. hostingWebView!)
202+ WebViewManager . shared. hostingWebView!. snp. makeConstraints { make in
203+ make. top. bottom. left. right. equalToSuperview ( )
204+ }
205+ }
206+ }
207+ }
208+ }
0 commit comments