Преглед изворни кода

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 пре 2 месеци
родитељ
комит
8a5fdc83c8

+ 5 - 0
App for Indeed/AppDelegate.swift

@@ -27,6 +27,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
 
             window.minSize = self.minimumWindowSize
             window.setContentSize(self.minimumWindowSize)
+            window.title = "App for Indeed"
+            window.styleMask.insert(.fullSizeContentView)
+            window.titlebarAppearsTransparent = true
+            window.titleVisibility = .hidden
+            window.isMovableByWindowBackground = true
             window.center()
             window.makeKeyAndOrderFront(nil)
         }

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

@@ -683,8 +683,8 @@
         <scene sceneID="R2V-B0-nI4">
             <objects>
                 <windowController id="B8D-0N-5wS" sceneMemberID="viewController">
-                    <window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="YES" animationBehavior="default" id="IQv-IB-iLA">
-                        <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
+                    <window key="window" title="App for Indeed" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="YES" animationBehavior="default" id="IQv-IB-iLA">
+                        <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
                         <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
                         <rect key="contentRect" x="196" y="240" width="480" height="270"/>
                         <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 {
 
             contentStack.leadingAnchor.constraint(equalTo: chromeContainer.leadingAnchor),
             contentStack.trailingAnchor.constraint(equalTo: chromeContainer.trailingAnchor),
-            contentStack.topAnchor.constraint(equalTo: chromeContainer.topAnchor),
+            contentStack.topAnchor.constraint(equalTo: safeAreaLayoutGuide.topAnchor),
             contentStack.bottomAnchor.constraint(equalTo: chromeContainer.bottomAnchor),
 
             sidebar.widthAnchor.constraint(equalToConstant: 218),