Browse Source

Integrate window traffic lights into app chrome

Use fullSizeContentView with a transparent title bar so the system
close/minimize/zoom controls sit on the dashboard chrome. Hide the
title bar text, set the window title to App for Indeed, and pin the
main content stack to the safe area so layout stays clear of the
controls. Enable dragging from the window background.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 3 weeks ago
parent
commit
8a5fdc83c8

+ 5 - 0
App for Indeed/AppDelegate.swift

@@ -27,6 +27,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
27 27
 
28 28
             window.minSize = self.minimumWindowSize
29 29
             window.setContentSize(self.minimumWindowSize)
30
+            window.title = "App for Indeed"
31
+            window.styleMask.insert(.fullSizeContentView)
32
+            window.titlebarAppearsTransparent = true
33
+            window.titleVisibility = .hidden
34
+            window.isMovableByWindowBackground = true
30 35
             window.center()
31 36
             window.makeKeyAndOrderFront(nil)
32 37
         }

+ 2 - 2
App for Indeed/Base.lproj/Main.storyboard

@@ -683,8 +683,8 @@
683 683
         <scene sceneID="R2V-B0-nI4">
684 684
             <objects>
685 685
                 <windowController id="B8D-0N-5wS" sceneMemberID="viewController">
686
-                    <window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="YES" animationBehavior="default" id="IQv-IB-iLA">
687
-                        <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
686
+                    <window key="window" title="App for Indeed" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="YES" animationBehavior="default" id="IQv-IB-iLA">
687
+                        <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
688 688
                         <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
689 689
                         <rect key="contentRect" x="196" y="240" width="480" height="270"/>
690 690
                         <rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>

+ 1 - 1
App for Indeed/Views/DashboardView.swift

@@ -255,7 +255,7 @@ final class DashboardView: NSView, NSTextFieldDelegate {
255 255
 
256 256
             contentStack.leadingAnchor.constraint(equalTo: chromeContainer.leadingAnchor),
257 257
             contentStack.trailingAnchor.constraint(equalTo: chromeContainer.trailingAnchor),
258
-            contentStack.topAnchor.constraint(equalTo: chromeContainer.topAnchor),
258
+            contentStack.topAnchor.constraint(equalTo: safeAreaLayoutGuide.topAnchor),
259 259
             contentStack.bottomAnchor.constraint(equalTo: chromeContainer.bottomAnchor),
260 260
 
261 261
             sidebar.widthAnchor.constraint(equalToConstant: 218),