소스 검색

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
3개의 변경된 파일8개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 0
      App for Indeed/AppDelegate.swift
  2. 2 2
      App for Indeed/Base.lproj/Main.storyboard
  3. 1 1
      App for Indeed/Views/DashboardView.swift

+ 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),