fix(panel): draggable header and configurable translation text size

Add a native AppKit drag grip to the non-activating panel header; it accepts the first mouse and calls performDrag, so the panel can be moved before it becomes key. Keep a moved position while the panel stays visible and only recenter near the cursor when it is shown again (DeepL-like transient position).

Add persisted translationFontSize (default 17 pt, range 12–28) to AppSettings and PanelConfiguration, apply it to the translation text, and expose a native Settings stepper. Add English/German strings and AppSettings clamp/round-trip tests.

Verified: make verify green; synthetic double-copy opened the panel, dragging the grip moved the window, and a 22 pt capture showed the larger translation text.
This commit is contained in:
schihei committed 2026-11-26 14:35:34 +01:00
1 parent 2cce12ff17
commit 40733473c5
12 files changed
+98 -5

No files matched your search

@@ -28,6 +28,8 @@ public struct PanelConfiguration: Sendable, Equatable {
public var sampling: SamplingOptions
/// Whether to show the source preview.
public var showSourcePreview: Bool
/// Translation text size in points.
public var translationFontSize: Int
/// Recent targets, most recent first.
public var recentTargets: [ModelLanguage]
@@ -38,6 +40,7 @@ public struct PanelConfiguration: Sendable, Equatable {
keepAlive: String,
sampling: SamplingOptions = .publisherDefault,
showSourcePreview: Bool = true,
translationFontSize: Int = 17,
recentTargets: [ModelLanguage] = []
) {
self.target = target
@@ -45,6 +48,7 @@ public struct PanelConfiguration: Sendable, Equatable {
self.keepAlive = keepAlive
self.sampling = sampling
self.showSourcePreview = showSourcePreview
self.translationFontSize = translationFontSize
self.recentTargets = recentTargets
}
}