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

Polish AI Companion Get Notes button styling.

Use a rounded pill button with a notes icon and hover states so the notes action reads more clearly and feels consistent with the app's modern UI.

Co-authored-by: Cursor <cursoragent@cursor.com>
huzaifahayat12 1 месяц назад
Родитель
Сommit
7d93675ebb
1 измененных файлов с 24 добавлено и 4 удалено
  1. 24 4
      meetings_app/ViewController.swift

+ 24 - 4
meetings_app/ViewController.swift

@@ -2756,14 +2756,34 @@ private extension ViewController {
2756 2756
         let savedTimeLabel = textLabel("Saved time: \(savedTimeText)", font: typography.fieldLabel, color: palette.textMuted)
2757 2757
         savedTimeLabel.alignment = .left
2758 2758
 
2759
-        let notesButton = NSButton(title: "Get notes", target: self, action: #selector(aiCompanionNotesTapped(_:)))
2759
+        let notesButton = HoverButton(title: "Get Notes", target: self, action: #selector(aiCompanionNotesTapped(_:)))
2760 2760
         notesButton.translatesAutoresizingMaskIntoConstraints = false
2761 2761
         notesButton.isBordered = false
2762
-        notesButton.bezelStyle = .inline
2762
+        notesButton.bezelStyle = .regularSquare
2763
+        notesButton.wantsLayer = true
2764
+        notesButton.layer?.cornerRadius = 16
2765
+        notesButton.layer?.masksToBounds = true
2766
+        notesButton.layer?.borderWidth = 1
2763 2767
         notesButton.font = NSFont.systemFont(ofSize: 13, weight: .semibold)
2764 2768
         notesButton.contentTintColor = palette.primaryBlue
2765
-        notesButton.alignment = .left
2766
-        notesButton.setButtonType(.momentaryPushIn)
2769
+        notesButton.alignment = .center
2770
+        notesButton.setButtonType(.momentaryChange)
2771
+        notesButton.focusRingType = .none
2772
+        notesButton.image = NSImage(systemSymbolName: "note.text", accessibilityDescription: "Get Notes")
2773
+        notesButton.symbolConfiguration = NSImage.SymbolConfiguration(pointSize: 13, weight: .semibold)
2774
+        notesButton.imagePosition = .imageLeading
2775
+        notesButton.imageHugsTitle = true
2776
+        notesButton.heightAnchor.constraint(equalToConstant: 32).isActive = true
2777
+        notesButton.widthAnchor.constraint(greaterThanOrEqualToConstant: 112).isActive = true
2778
+        let notesBaseFill = palette.primaryBlue.withAlphaComponent(darkModeEnabled ? 0.20 : 0.14)
2779
+        let notesHoverFill = palette.primaryBlue.withAlphaComponent(darkModeEnabled ? 0.30 : 0.22)
2780
+        let notesBaseBorder = palette.primaryBlue.withAlphaComponent(darkModeEnabled ? 0.65 : 0.52)
2781
+        let notesHoverBorder = palette.primaryBlue.withAlphaComponent(darkModeEnabled ? 0.90 : 0.72)
2782
+        notesButton.onHoverChanged = { [weak notesButton] hovering in
2783
+            notesButton?.layer?.backgroundColor = (hovering ? notesHoverFill : notesBaseFill).cgColor
2784
+            notesButton?.layer?.borderColor = (hovering ? notesHoverBorder : notesBaseBorder).cgColor
2785
+        }
2786
+        notesButton.onHoverChanged?(false)
2767 2787
         aiCompanionNotesMeetingIdByView[ObjectIdentifier(notesButton)] = recording.id
2768 2788
 
2769 2789
         let notesStatusLabel = textLabel(aiCompanionNotesStatusText(for: recording), font: typography.fieldLabel, color: palette.textMuted)