Procházet zdrojové kódy

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 před 2 měsíci
rodič
revize
7d93675ebb
1 změnil soubory, kde provedl 24 přidání a 4 odebrání
  1. 24 4
      meetings_app/ViewController.swift

+ 24 - 4
meetings_app/ViewController.swift

@@ -2756,14 +2756,34 @@ private extension ViewController {
         let savedTimeLabel = textLabel("Saved time: \(savedTimeText)", font: typography.fieldLabel, color: palette.textMuted)
         savedTimeLabel.alignment = .left
 
-        let notesButton = NSButton(title: "Get notes", target: self, action: #selector(aiCompanionNotesTapped(_:)))
+        let notesButton = HoverButton(title: "Get Notes", target: self, action: #selector(aiCompanionNotesTapped(_:)))
         notesButton.translatesAutoresizingMaskIntoConstraints = false
         notesButton.isBordered = false
-        notesButton.bezelStyle = .inline
+        notesButton.bezelStyle = .regularSquare
+        notesButton.wantsLayer = true
+        notesButton.layer?.cornerRadius = 16
+        notesButton.layer?.masksToBounds = true
+        notesButton.layer?.borderWidth = 1
         notesButton.font = NSFont.systemFont(ofSize: 13, weight: .semibold)
         notesButton.contentTintColor = palette.primaryBlue
-        notesButton.alignment = .left
-        notesButton.setButtonType(.momentaryPushIn)
+        notesButton.alignment = .center
+        notesButton.setButtonType(.momentaryChange)
+        notesButton.focusRingType = .none
+        notesButton.image = NSImage(systemSymbolName: "note.text", accessibilityDescription: "Get Notes")
+        notesButton.symbolConfiguration = NSImage.SymbolConfiguration(pointSize: 13, weight: .semibold)
+        notesButton.imagePosition = .imageLeading
+        notesButton.imageHugsTitle = true
+        notesButton.heightAnchor.constraint(equalToConstant: 32).isActive = true
+        notesButton.widthAnchor.constraint(greaterThanOrEqualToConstant: 112).isActive = true
+        let notesBaseFill = palette.primaryBlue.withAlphaComponent(darkModeEnabled ? 0.20 : 0.14)
+        let notesHoverFill = palette.primaryBlue.withAlphaComponent(darkModeEnabled ? 0.30 : 0.22)
+        let notesBaseBorder = palette.primaryBlue.withAlphaComponent(darkModeEnabled ? 0.65 : 0.52)
+        let notesHoverBorder = palette.primaryBlue.withAlphaComponent(darkModeEnabled ? 0.90 : 0.72)
+        notesButton.onHoverChanged = { [weak notesButton] hovering in
+            notesButton?.layer?.backgroundColor = (hovering ? notesHoverFill : notesBaseFill).cgColor
+            notesButton?.layer?.borderColor = (hovering ? notesHoverBorder : notesBaseBorder).cgColor
+        }
+        notesButton.onHoverChanged?(false)
         aiCompanionNotesMeetingIdByView[ObjectIdentifier(notesButton)] = recording.id
 
         let notesStatusLabel = textLabel(aiCompanionNotesStatusText(for: recording), font: typography.fieldLabel, color: palette.textMuted)