Просмотр исходного кода

Remove theme picker from settings and set main window height to 770.

The app keeps a fixed light appearance; default and minimum content height are now 770pt so launch and resize match the intended layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 недель назад: 3
Родитель
Сommit
8c7aafc519

+ 2 - 2
App for Indeed/AppDelegate.swift

@@ -8,8 +8,8 @@
8 8
 import Cocoa
9 9
 
10 10
 enum AppWindowConfiguration {
11
-    static let defaultContentSize = NSSize(width: 1120, height: 750)
12
-    static let minimumContentSize = NSSize(width: 1120, height: 750)
11
+    static let defaultContentSize = NSSize(width: 1120, height: 770)
12
+    static let minimumContentSize = NSSize(width: 1120, height: 770)
13 13
 
14 14
     @MainActor
15 15
     static func apply(to window: NSWindow) {

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

@@ -686,7 +686,7 @@
686 686
                     <window key="window" title="App for Indeed" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="YES" animationBehavior="default" id="IQv-IB-iLA">
687 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
-                        <rect key="contentRect" x="196" y="240" width="1120" height="750"/>
689
+                        <rect key="contentRect" x="196" y="240" width="1120" height="770"/>
690 690
                         <rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
691 691
                         <connections>
692 692
                             <outlet property="delegate" destination="B8D-0N-5wS" id="98r-iN-zZc"/>
@@ -705,7 +705,7 @@
705 705
             <objects>
706 706
                 <viewController id="XfG-lQ-9wD" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
707 707
                     <view key="view" id="m2S-Jp-Qdl">
708
-                        <rect key="frame" x="0.0" y="0.0" width="1120" height="750"/>
708
+                        <rect key="frame" x="0.0" y="0.0" width="1120" height="770"/>
709 709
                         <autoresizingMask key="autoresizingMask"/>
710 710
                     </view>
711 711
                 </viewController>

+ 0 - 42
App for Indeed/Views/DashboardView.swift

@@ -120,7 +120,6 @@ final class DashboardView: NSView, NSTextFieldDelegate {
120 120
     private let savedJobsDocumentView = JobListingsDocumentView()
121 121
     private let savedJobsStack = NSStackView()
122 122
     private let settingsPageContainer = NSView()
123
-    private let themeControl = NSSegmentedControl()
124 123
     private let cvMakerPageContainer = NSView()
125 124
     private lazy var cvMakerPageView: CVMakerPageView = {
126 125
         CVMakerPageView()
@@ -1498,7 +1497,6 @@ final class DashboardView: NSView, NSTextFieldDelegate {
1498 1497
 
1499 1498
         let settingsSection = makeSettingsSection(rows: [
1500 1499
             makeSettingsRow(title: "Share App", systemImage: "square.and.arrow.up", accessory: nil),
1501
-            makeSettingsRow(title: "Theme", systemImage: "circle.lefthalf.filled", accessory: makeThemeControl()),
1502 1500
             makeSettingsRow(title: "More Apps", systemImage: "square.grid.2x2", accessory: nil)
1503 1501
         ])
1504 1502
 
@@ -1534,35 +1532,6 @@ final class DashboardView: NSView, NSTextFieldDelegate {
1534 1532
         ])
1535 1533
     }
1536 1534
 
1537
-    private func makeThemeControl() -> NSSegmentedControl {
1538
-        themeControl.segmentCount = 3
1539
-        themeControl.trackingMode = .selectOne
1540
-        themeControl.setLabel("System", forSegment: 0)
1541
-        themeControl.setLabel("Light", forSegment: 1)
1542
-        themeControl.setLabel("Dark", forSegment: 2)
1543
-        themeControl.target = self
1544
-        themeControl.action = #selector(didChangeThemeSelection(_:))
1545
-        switch NSApp.appearance?.bestMatch(from: [.darkAqua, .aqua]) {
1546
-        case .darkAqua:
1547
-            themeControl.selectedSegment = 2
1548
-        case .aqua:
1549
-            themeControl.selectedSegment = 1
1550
-        default:
1551
-            themeControl.selectedSegment = 0
1552
-        }
1553
-        themeControl.segmentStyle = .rounded
1554
-        themeControl.segmentDistribution = .fillEqually
1555
-        themeControl.setWidth(68, forSegment: 0)
1556
-        themeControl.setWidth(68, forSegment: 1)
1557
-        themeControl.setWidth(68, forSegment: 2)
1558
-        themeControl.controlSize = .large
1559
-        themeControl.font = .systemFont(ofSize: 13, weight: .semibold)
1560
-        themeControl.translatesAutoresizingMaskIntoConstraints = false
1561
-        themeControl.widthAnchor.constraint(equalToConstant: 204).isActive = true
1562
-        themeControl.heightAnchor.constraint(equalToConstant: 30).isActive = true
1563
-        return themeControl
1564
-    }
1565
-
1566 1535
     private func makeSettingsSection(rows: [NSView]) -> NSView {
1567 1536
         let section = NSStackView()
1568 1537
         section.orientation = .vertical
@@ -2509,17 +2478,6 @@ final class DashboardView: NSView, NSTextFieldDelegate {
2509 2478
         }
2510 2479
     }
2511 2480
 
2512
-    @objc private func didChangeThemeSelection(_ sender: NSSegmentedControl) {
2513
-        switch sender.selectedSegment {
2514
-        case 1:
2515
-            NSApp.appearance = NSAppearance(named: .aqua)
2516
-        case 2:
2517
-            NSApp.appearance = NSAppearance(named: .darkAqua)
2518
-        default:
2519
-            NSApp.appearance = nil
2520
-        }
2521
-    }
2522
-
2523 2481
     private func selectSidebarItem(at index: Int) {
2524 2482
         dismissIndeedJobBrowserEmbedded()
2525 2483
         guard index >= 0, index < currentSidebarItems.count else { return }