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

Replace tutorial/background placeholders with schedule and calendar navigation.

This updates the sidebar labels and icons, removes the unused Tutorials page, and aligns window/page titles with the new planning-focused sections.

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

+ 19 - 19
meetings_app/ViewController.swift

@@ -15,8 +15,7 @@ private enum SidebarPage: Int {
15 15
     case joinMeetings = 0
16 16
     case photo = 1
17 17
     case video = 2
18
-    case tutorials = 3
19
-    case settings = 4
18
+    case settings = 3
20 19
 }
21 20
 
22 21
 private enum ZoomJoinMode: Int {
@@ -1294,11 +1293,9 @@ private extension ViewController {
1294 1293
         case .joinMeetings:
1295 1294
             built = makeJoinMeetingsContent()
1296 1295
         case .photo:
1297
-            built = makePlaceholderPage(title: "Photo", subtitle: "Backgrounds — choose a photo background for your meetings.")
1296
+            built = makePlaceholderPage(title: "Schedule", subtitle: "Create and manage your upcoming meetings.")
1298 1297
         case .video:
1299
-            built = makePlaceholderPage(title: "Video", subtitle: "Backgrounds — video background options.")
1300
-        case .tutorials:
1301
-            built = makePlaceholderPage(title: "Tutorials", subtitle: "Learn how to use the app.")
1298
+            built = makePlaceholderPage(title: "Calendar", subtitle: "View meetings by date and track your plan.")
1302 1299
         case .settings:
1303 1300
             built = makePlaceholderPage(title: "Settings", subtitle: "Preferences and account options.")
1304 1301
         }
@@ -1428,11 +1425,9 @@ private extension ViewController {
1428 1425
         case .joinMeetings:
1429 1426
             title = "App for Google Meet"
1430 1427
         case .photo:
1431
-            title = "Backgrounds — Photo"
1428
+            title = "Schedule"
1432 1429
         case .video:
1433
-            title = "Backgrounds — Video"
1434
-        case .tutorials:
1435
-            title = "Tutorials"
1430
+            title = "Calendar"
1436 1431
         case .settings:
1437 1432
             title = "Settings"
1438 1433
         }
@@ -1473,7 +1468,7 @@ private extension ViewController {
1473 1468
 
1474 1469
     private func logoTemplateForSidebarPage(_ page: SidebarPage) -> Bool {
1475 1470
         switch page {
1476
-        case .photo, .tutorials: return false
1471
+        case .photo: return false
1477 1472
         case .joinMeetings, .video, .settings: return true
1478 1473
         }
1479 1474
     }
@@ -1525,17 +1520,14 @@ private extension ViewController {
1525 1520
         let joinRow = sidebarItem("Join Meetings", icon: "􀉣", page: .joinMeetings, logoImageName: "JoinMeetingsLogo", logoIconWidth: 24, logoHeightMultiplier: 56.0 / 52.0)
1526 1521
         menuStack.addArrangedSubview(joinRow)
1527 1522
         sidebarRowViews[.joinMeetings] = joinRow
1528
-        menuStack.addArrangedSubview(sidebarSectionTitle("Backgrounds"))
1529
-        let photoRow = sidebarItem("Photo", icon: "􀏂", page: .photo, logoImageName: "SidebarPhotoLogo", logoIconWidth: 24, logoHeightMultiplier: 82.0 / 62.0)
1523
+        menuStack.addArrangedSubview(sidebarSectionTitle("Planning"))
1524
+        let photoRow = sidebarItem("Schedule", icon: "􀏂", page: .photo, systemSymbolName: "clock.badge.checkmark")
1530 1525
         menuStack.addArrangedSubview(photoRow)
1531 1526
         sidebarRowViews[.photo] = photoRow
1532
-        let videoRow = sidebarItem("Video", icon: "􀎚", page: .video, logoImageName: "SidebarVideoLogo", logoIconWidth: 28, logoHeightMultiplier: 52.0 / 60.0)
1527
+        let videoRow = sidebarItem("Calendar", icon: "􀎚", page: .video, systemSymbolName: "calendar")
1533 1528
         menuStack.addArrangedSubview(videoRow)
1534 1529
         sidebarRowViews[.video] = videoRow
1535 1530
         menuStack.addArrangedSubview(sidebarSectionTitle("Additional"))
1536
-        let tutorialsRow = sidebarItem("Tutorials", icon: "􀛩", page: .tutorials, logoImageName: "SidebarTutorialsLogo", logoIconWidth: 24, logoHeightMultiplier: 50.0 / 60.0)
1537
-        menuStack.addArrangedSubview(tutorialsRow)
1538
-        sidebarRowViews[.tutorials] = tutorialsRow
1539 1531
         let settingsRow = sidebarItem("Settings", icon: "􀍟", page: .settings, logoImageName: "SidebarSettingsLogo", logoIconWidth: 28, logoHeightMultiplier: 68.0 / 62.0, showsDisclosure: true)
1540 1532
         menuStack.addArrangedSubview(settingsRow)
1541 1533
         sidebarRowViews[.settings] = settingsRow
@@ -3768,7 +3760,7 @@ private extension ViewController {
3768 3760
         return field
3769 3761
     }
3770 3762
 
3771
-    func sidebarItem(_ text: String, icon: String, page: SidebarPage, logoImageName: String? = nil, logoIconWidth: CGFloat = 18, logoHeightMultiplier: CGFloat = 1, logoTemplate: Bool = true, showsDisclosure: Bool = false) -> NSView {
3763
+    func sidebarItem(_ text: String, icon: String, page: SidebarPage, logoImageName: String? = nil, systemSymbolName: String? = nil, logoIconWidth: CGFloat = 18, logoHeightMultiplier: CGFloat = 1, logoTemplate: Bool = true, showsDisclosure: Bool = false) -> NSView {
3772 3764
         let item = HoverButton(title: "", target: self, action: #selector(sidebarButtonClicked(_:)))
3773 3765
         item.tag = page.rawValue
3774 3766
         item.isBordered = false
@@ -3789,6 +3781,14 @@ private extension ViewController {
3789 3781
             imageView.imageAlignment = .alignCenter
3790 3782
             imageView.isEditable = false
3791 3783
             leadingView = imageView
3784
+        } else if let symbolName = systemSymbolName, let symbol = NSImage(systemSymbolName: symbolName, accessibilityDescription: text) {
3785
+            symbol.isTemplate = true
3786
+            let imageView = NSImageView(image: symbol)
3787
+            imageView.translatesAutoresizingMaskIntoConstraints = false
3788
+            imageView.imageScaling = .scaleProportionallyDown
3789
+            imageView.imageAlignment = .alignCenter
3790
+            imageView.isEditable = false
3791
+            leadingView = imageView
3792 3792
         } else {
3793 3793
             leadingView = textLabel(icon, font: typography.sidebarIcon, color: palette.textSecondary)
3794 3794
         }
@@ -3820,7 +3820,7 @@ private extension ViewController {
3820 3820
             constraints.append(titleLabel.trailingAnchor.constraint(lessThanOrEqualTo: item.trailingAnchor, constant: -10))
3821 3821
         }
3822 3822
 
3823
-        if logoImageName != nil {
3823
+        if logoImageName != nil || systemSymbolName != nil {
3824 3824
             let h = logoIconWidth * logoHeightMultiplier
3825 3825
             constraints.append(contentsOf: [
3826 3826
                 leadingView.widthAnchor.constraint(equalToConstant: logoIconWidth),