style: match translation footer action ordering and keycaps
This commit is contained in:
@@ -134,6 +134,8 @@ Notes autosave locally as RTFD packages, including embedded images, under `~/Lib
|
||||
|
||||
Search for **Conjure Translate**, identified by its centered 🌏 icon, and open it. Choose a provider in the pill-shaped header selector, enter text in the search bar, then press Return or click **Translate**. Typing alone never sends text. When the translation is available, the action changes to **Copy**: press Return or click it to copy the full translation and close Conjure. Command-C still copies selected output. Editing the input restores **Translate**.
|
||||
|
||||
The footer places **Translate/Copy** and its Return keycap before **Actions**, whose Command and K keys use separate keycaps, matching the launcher.
|
||||
|
||||
Press Command-P or click the provider selector to expand a searchable action-style popup from its top edge downwards, hiding the indicator until the popup closes. A checkmark marks the current provider. Use Up/Down and Return or click a provider to select it; Escape, Back, or clicking outside closes the popup. Changing providers clears the previous result without submitting a request.
|
||||
|
||||
The footer shows the current language pair (initially **English → Japanese**). Click it or open **Actions** with Command-K to change the source language, change the target language, or swap them. Language choices are saved locally and apply to both providers. Changing languages clears the previous result without submitting another request. The input hint and output accessibility label follow the selected pair. Escape closes an open action/provider picker first and dismisses the window only when no picker is open. Back closes the picker first, then returns to the launcher and restores your search. Command-W always dismisses the entire window.
|
||||
|
||||
@@ -130,22 +130,22 @@ final class TranslationController: NSViewController {
|
||||
let returnKey = ShortcutIndicator("↵")
|
||||
let actionPill = NSView()
|
||||
stylePill(actionPill)
|
||||
let actionsKey = ShortcutIndicator("⌘K")
|
||||
for control in [actionsButton, actionsKey, translateButton, returnKey] {
|
||||
let actionsKey = ShortcutIndicator("⌘", "K")
|
||||
for control in [translateButton, returnKey, actionsButton, actionsKey] {
|
||||
control.translatesAutoresizingMaskIntoConstraints = false
|
||||
actionPill.addSubview(control)
|
||||
}
|
||||
NSLayoutConstraint.activate([
|
||||
actionPill.heightAnchor.constraint(equalToConstant: 36),
|
||||
actionsButton.leadingAnchor.constraint(equalTo: actionPill.leadingAnchor, constant: 14),
|
||||
actionsButton.centerYAnchor.constraint(equalTo: actionPill.centerYAnchor),
|
||||
actionsKey.leadingAnchor.constraint(equalTo: actionsButton.trailingAnchor, constant: 8),
|
||||
actionsKey.centerYAnchor.constraint(equalTo: actionPill.centerYAnchor),
|
||||
translateButton.leadingAnchor.constraint(equalTo: actionsKey.trailingAnchor, constant: 16),
|
||||
translateButton.leadingAnchor.constraint(equalTo: actionPill.leadingAnchor, constant: 14),
|
||||
translateButton.centerYAnchor.constraint(equalTo: actionPill.centerYAnchor),
|
||||
returnKey.leadingAnchor.constraint(equalTo: translateButton.trailingAnchor, constant: 8),
|
||||
returnKey.centerYAnchor.constraint(equalTo: actionPill.centerYAnchor),
|
||||
returnKey.trailingAnchor.constraint(equalTo: actionPill.trailingAnchor, constant: -12),
|
||||
actionsButton.leadingAnchor.constraint(equalTo: returnKey.trailingAnchor, constant: 14),
|
||||
actionsButton.centerYAnchor.constraint(equalTo: actionPill.centerYAnchor),
|
||||
actionsKey.leadingAnchor.constraint(equalTo: actionsButton.trailingAnchor, constant: 8),
|
||||
actionsKey.centerYAnchor.constraint(equalTo: actionPill.centerYAnchor),
|
||||
actionsKey.trailingAnchor.constraint(equalTo: actionPill.trailingAnchor, constant: -12),
|
||||
])
|
||||
let footer = NSStackView(views: [languageButton, status, settingsButton, NSView(), actionPill])
|
||||
footer.orientation = .horizontal
|
||||
|
||||
Reference in New Issue
Block a user