fix: use shared action pill in notes header
This commit is contained in:
@@ -68,7 +68,7 @@ Right-click the launcher background for Settings and Quit. Actions include favor
|
|||||||
|
|
||||||
Action and selection popups paint a popup-sized background using the launcher window’s gradient coordinates, keeping the glows continuous without showing the results underneath. Each opening rebuilds the complete native view and layer tree, rather than resizing a retained presentation between the footer and header. Callbacks and selection behavior stay in the controller. Layout finishes before the opening fade, including when switching popup types.
|
Action and selection popups paint a popup-sized background using the launcher window’s gradient coordinates, keeping the glows continuous without showing the results underneath. Each opening rebuilds the complete native view and layer tree, rather than resizing a retained presentation between the footer and header. Callbacks and selection behavior stay in the controller. Layout finishes before the opening fade, including when switching popup types.
|
||||||
|
|
||||||
The launcher, emoji picker, and Translate share `ActionPill` for footer styling, alignment, spacing, and keyboard indicators: primary action first, then Actions with separate Command and K keycaps. Notes instead uses a compact icon-only title bar and formatting strip. Controllers supply the buttons and retain their targets, enabled state, and popup behavior.
|
The launcher, emoji picker, Translate, and Notes share `ActionPill` for styling, alignment, spacing, and keyboard indicators: primary action first, then Actions with separate Command and K keycaps. Notes places Browse Notes (Command-P) and Actions (Command-K) in its title-bar pill; New Note remains in Actions and on Command-N. Controllers supply the buttons and retain their targets, enabled state, and popup behavior.
|
||||||
|
|
||||||
The header’s trailing edge is constrained to the footer’s trailing edge. The translation provider pill and footer pill therefore share the same 8-point right inset and 36-point height.
|
The header’s trailing edge is constrained to the footer’s trailing edge. The translation provider pill and footer pill therefore share the same 8-point right inset and 36-point height.
|
||||||
|
|
||||||
@@ -145,7 +145,7 @@ Actions (Command-K) opens the same searchable popup style used throughout Conjur
|
|||||||
|
|
||||||
The bottom strip applies Markdown headings, bold, italic, strikethrough, inline code, links, fenced code blocks, quotes, numbered lists, bullet lists, and checklists. Formatting preserves embedded images and supports Undo. List buttons convert existing list types; clicking the current type removes its marker. The formatting strip is always visible. Successful autosaves stay unobtrusive; only save, load, or deletion errors appear below the editor.
|
The bottom strip applies Markdown headings, bold, italic, strikethrough, inline code, links, fenced code blocks, quotes, numbered lists, bullet lists, and checklists. Formatting preserves embedded images and supports Undo. List buttons convert existing list types; clicking the current type removes its marker. The formatting strip is always visible. Successful autosaves stay unobtrusive; only save, load, or deletion errors appear below the editor.
|
||||||
|
|
||||||
Note text fades over 16 points at the editor’s scroll edges rather than clipping sharply above the formatting strip. Matching 16-point scroll insets keep the first and last lines clear of the fade when scrolled to either end. The compact 32-point header and 28-point formatting strip meet the editor without extra vertical gaps.
|
Note text fades over 16 points at the editor’s scroll edges rather than clipping sharply above the formatting strip. Matching 16-point scroll insets keep the first and last lines clear of the fade when scrolled to either end. The 36-point action-pill header and 28-point formatting strip meet the editor without extra vertical gaps.
|
||||||
|
|
||||||
Formatting shortcuts use the same actions as the bottom strip. They apply to the editor’s current selection or caret, never to text in an open picker. Hover over a formatting button to see its shortcut. Command-K remains Actions.
|
Formatting shortcuts use the same actions as the bottom strip. They apply to the editor’s current selection or caret, never to text in an open picker. Hover over a formatting button to see its shortcut. Command-K remains Actions.
|
||||||
|
|
||||||
|
|||||||
@@ -53,14 +53,9 @@ final class NotesController: NSViewController, NSTextViewDelegate {
|
|||||||
view = content
|
view = content
|
||||||
browseButton.target = self
|
browseButton.target = self
|
||||||
browseButton.action = #selector(browseNotes)
|
browseButton.action = #selector(browseNotes)
|
||||||
configureIcon(browseButton, symbol: "note.text", label: "Browse notes (⌘P)")
|
|
||||||
browseButton.keyEquivalent = "p"
|
|
||||||
actionsButton.target = self
|
actionsButton.target = self
|
||||||
actionsButton.action = #selector(showActions)
|
actionsButton.action = #selector(showActions)
|
||||||
configureIcon(actionsButton, symbol: "command", label: "Notes actions (⌘K)")
|
let controls = ActionPill(primaryButton: browseButton, actionsButton: actionsButton, primaryCommand: "p")
|
||||||
let create = iconButton("plus", label: "New note (⌘N)", action: #selector(newNote))
|
|
||||||
let controls = NSStackView(views: [actionsButton, browseButton, create])
|
|
||||||
controls.spacing = 2
|
|
||||||
noteTitle.font = .systemFont(ofSize: 13)
|
noteTitle.font = .systemFont(ofSize: 13)
|
||||||
noteTitle.textColor = SunsetPalette.secondaryText
|
noteTitle.textColor = SunsetPalette.secondaryText
|
||||||
noteTitle.alignment = .center
|
noteTitle.alignment = .center
|
||||||
@@ -147,7 +142,7 @@ final class NotesController: NSViewController, NSTextViewDelegate {
|
|||||||
header.topAnchor.constraint(equalTo: view.topAnchor),
|
header.topAnchor.constraint(equalTo: view.topAnchor),
|
||||||
header.leadingAnchor.constraint(equalTo: view.leadingAnchor),
|
header.leadingAnchor.constraint(equalTo: view.leadingAnchor),
|
||||||
header.trailingAnchor.constraint(equalTo: view.trailingAnchor),
|
header.trailingAnchor.constraint(equalTo: view.trailingAnchor),
|
||||||
header.heightAnchor.constraint(equalToConstant: 32),
|
header.heightAnchor.constraint(equalToConstant: 36),
|
||||||
body.topAnchor.constraint(equalTo: header.bottomAnchor),
|
body.topAnchor.constraint(equalTo: header.bottomAnchor),
|
||||||
body.leadingAnchor.constraint(equalTo: view.leadingAnchor),
|
body.leadingAnchor.constraint(equalTo: view.leadingAnchor),
|
||||||
body.trailingAnchor.constraint(equalTo: view.trailingAnchor),
|
body.trailingAnchor.constraint(equalTo: view.trailingAnchor),
|
||||||
@@ -162,7 +157,7 @@ final class NotesController: NSViewController, NSTextViewDelegate {
|
|||||||
])
|
])
|
||||||
guard let store else {
|
guard let store else {
|
||||||
editor.isEditable = false
|
editor.isEditable = false
|
||||||
for control in [browseButton, actionsButton, create] { control.isEnabled = false }
|
for control in [browseButton, actionsButton] { control.isEnabled = false }
|
||||||
formatting.subviews.compactMap { $0 as? NSButton }.forEach { $0.isEnabled = false }
|
formatting.subviews.compactMap { $0 as? NSButton }.forEach { $0.isEnabled = false }
|
||||||
showError(loadError!)
|
showError(loadError!)
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user