feat(desktop): Settings — 🌐 Global toggle per voice hotkey

This commit is contained in:
byGalax
2026-05-16 16:43:00 +02:00
parent ca77214e2d
commit 79f1786ac6
+22
View File
@@ -575,6 +575,7 @@ function VoiceHotkeyControls({ kind }: { kind: VoiceHotkeyKind }) {
<SettingRow
label={t('app:settings.hotkey_binding', { defaultValue: 'Hotkey' })}
>
<div className="flex items-center gap-2">
<button
type="button"
onClick={() => setCapturing((v) => !v)}
@@ -591,6 +592,27 @@ function VoiceHotkeyControls({ kind }: { kind: VoiceHotkeyKind }) {
})
: binding.keyLabel}
</button>
<button
type="button"
onClick={() => updateVoiceHotkey(kind, { global: !binding.global })}
disabled={!binding.enabled}
aria-pressed={binding.global}
title={
binding.global
? 'Global: feuert auch wenn Netralax nicht fokussiert ist (PTT-Stil)'
: 'Nur im Fenster: feuert nur wenn Netralax fokussiert ist (empfohlen)'
}
className={
'ml-2 inline-flex h-7 cursor-pointer items-center gap-1 rounded-md border px-2 text-[11px] font-semibold transition focus:outline-none focus-visible:ring-2 focus-visible:ring-accent/40 disabled:cursor-not-allowed disabled:opacity-50 ' +
(binding.global
? 'border-accent/40 bg-accent/15 text-accent'
: 'border-line bg-surface-3 text-fg-muted hover:text-fg')
}
>
<span aria-hidden>🌐</span>
<span>{binding.global ? 'Global' : 'Im Fenster'}</span>
</button>
</div>
</SettingRow>
</>
);