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

Darken light-mode sidebar text and icon colors for better contrast.

This updates sidebar section labels and unselected item/icon tints to a stronger black tone so the left navigation reads more clearly.

Made-with: Cursor
huzaifahayat12 пре 1 месец
родитељ
комит
5eb1d71b88
1 измењених фајлова са 8 додато и 5 уклоњено
  1. 8 5
      meetings_app/ViewController.swift

+ 8 - 5
meetings_app/ViewController.swift

@@ -5085,7 +5085,8 @@ private extension ViewController {
5085
     }
5085
     }
5086
 
5086
 
5087
     func sidebarSectionTitle(_ text: String) -> NSTextField {
5087
     func sidebarSectionTitle(_ text: String) -> NSTextField {
5088
-        let field = textLabel(text, font: typography.sidebarSection, color: palette.textMuted)
5088
+        let sectionColor = darkModeEnabled ? palette.textMuted : NSColor(calibratedWhite: 0.14, alpha: 1.0)
5089
+        let field = textLabel(text, font: typography.sidebarSection, color: sectionColor)
5089
         field.alignment = .left
5090
         field.alignment = .left
5090
         return field
5091
         return field
5091
     }
5092
     }
@@ -5123,7 +5124,8 @@ private extension ViewController {
5123
             leadingView = textLabel(icon, font: typography.sidebarIcon, color: palette.textSecondary)
5124
             leadingView = textLabel(icon, font: typography.sidebarIcon, color: palette.textSecondary)
5124
         }
5125
         }
5125
 
5126
 
5126
-        let titleLabel = textLabel(text, font: typography.sidebarItem, color: palette.textSecondary)
5127
+        let baseSidebarTextColor = darkModeEnabled ? palette.textSecondary : NSColor(calibratedWhite: 0.08, alpha: 1.0)
5128
+        let titleLabel = textLabel(text, font: typography.sidebarItem, color: baseSidebarTextColor)
5127
         titleLabel.alignment = .left
5129
         titleLabel.alignment = .left
5128
 
5130
 
5129
         item.addSubview(leadingView)
5131
         item.addSubview(leadingView)
@@ -5137,7 +5139,7 @@ private extension ViewController {
5137
         ]
5139
         ]
5138
 
5140
 
5139
         if showsDisclosure {
5141
         if showsDisclosure {
5140
-            let chevron = textLabel("›", font: NSFont.systemFont(ofSize: 22, weight: .semibold), color: palette.textSecondary)
5142
+            let chevron = textLabel("›", font: NSFont.systemFont(ofSize: 22, weight: .semibold), color: baseSidebarTextColor)
5141
             chevron.translatesAutoresizingMaskIntoConstraints = false
5143
             chevron.translatesAutoresizingMaskIntoConstraints = false
5142
             chevron.alignment = .right
5144
             chevron.alignment = .right
5143
             item.addSubview(chevron)
5145
             item.addSubview(chevron)
@@ -5172,8 +5174,9 @@ private extension ViewController {
5172
         let selected = (page == selectedSidebarPage)
5174
         let selected = (page == selectedSidebarPage)
5173
         let hoverColor = darkModeEnabled ? NSColor(calibratedWhite: 1, alpha: 0.07) : NSColor(calibratedWhite: 0, alpha: 0.08)
5175
         let hoverColor = darkModeEnabled ? NSColor(calibratedWhite: 1, alpha: 0.07) : NSColor(calibratedWhite: 0, alpha: 0.08)
5174
         item.layer?.backgroundColor = (selected ? palette.primaryBlue : (hovering ? hoverColor : NSColor.clear)).cgColor
5176
         item.layer?.backgroundColor = (selected ? palette.primaryBlue : (hovering ? hoverColor : NSColor.clear)).cgColor
5175
-        let tint = selected ? NSColor.white : palette.textSecondary
5176
-        let sidebarIconTint = darkModeEnabled ? tint : NSColor.black
5177
+        let baseSidebarTextColor = darkModeEnabled ? palette.textSecondary : NSColor(calibratedWhite: 0.08, alpha: 1.0)
5178
+        let tint = selected ? NSColor.white : baseSidebarTextColor
5179
+        let sidebarIconTint = darkModeEnabled ? tint : baseSidebarTextColor
5177
         guard item.subviews.count >= 2 else { return }
5180
         guard item.subviews.count >= 2 else { return }
5178
         let leading = item.subviews[0]
5181
         let leading = item.subviews[0]
5179
         let title = item.subviews.first { $0 is NSTextField } as? NSTextField
5182
         let title = item.subviews.first { $0 is NSTextField } as? NSTextField