style: align translation controls with launcher design

This commit is contained in:
Valdemar Lorenzen
2026-10-15 11:16:49 +02:00
parent c31424b217
commit 31c651ecb1
4 changed files with 43 additions and 11 deletions
@@ -776,6 +776,7 @@ final class LauncherWindowController: NSWindowController, NSWindowDelegate, NSSe
translation = controller
controller.input = { [weak self] in self?.searchField.stringValue ?? "" }
let previousQuery = searchField.stringValue
let previousPlaceholder = searchField.placeholderAttributedString
controller.closed = { [weak self, weak controller] in
guard let self, let controller else { return }
controller.view.removeFromSuperview()
@@ -785,7 +786,7 @@ final class LauncherWindowController: NSWindowController, NSWindowDelegate, NSSe
view.setAccessibilityHidden(false)
view.alphaValue = 1
}
self.searchField.placeholderString = "Search apps, calculate, or convert…"
self.searchField.placeholderAttributedString = previousPlaceholder
self.searchField.setAccessibilityLabel("Search applications, calculate, or convert units and currencies")
self.searchField.stringValue = previousQuery
self.openButton.keyEquivalent = "\r"
@@ -796,7 +797,10 @@ final class LauncherWindowController: NSWindowController, NSWindowDelegate, NSSe
(window as? LauncherPanel)?.resetNumberHints()
openButton.keyEquivalent = ""
searchField.stringValue = ""
searchField.placeholderString = "Enter English text to translate…"
searchField.placeholderAttributedString = NSAttributedString(
string: "Enter English text to translate…",
attributes: previousPlaceholder?.attributes(at: 0, effectiveRange: nil) ?? [:]
)
searchField.setAccessibilityLabel("English text to translate into Japanese")
for view in launcherViews.dropFirst() {
view.isHidden = true