| 1 | import { useShellExpand } from "../lib/shellExpand"; |
| 2 | import { useGlobalShortcut } from "../lib/keyboardShortcuts"; |
| 3 | import { applyTextSize, DEFAULT_TEXT_SIZE, getTextSize, nextTextSize } from "../lib/textSize"; |
| 4 | |
| 5 | /** Global hotkey handler for shell-expand toggle (Ctrl/Cmd+B). */ |
| 6 | export function ShellHotkeys() { |
| 7 | const shellExpand = useShellExpand(); |
| 8 | useGlobalShortcut("shell.toggle", () => shellExpand?.toggleLast(), [shellExpand], Boolean(shellExpand)); |
| 9 | return null; |
| 10 | } |
| 11 | |
| 12 | /** Global hotkey handler for text-size shortcuts (Ctrl/Cmd + Plus/Minus/0). */ |
| 13 | export function TextSizeHotkeys() { |
| 14 | useGlobalShortcut("textSize.increase", () => applyTextSize(nextTextSize(getTextSize(), 1))); |
| 15 | useGlobalShortcut("textSize.decrease", () => applyTextSize(nextTextSize(getTextSize(), -1))); |
| 16 | useGlobalShortcut("textSize.reset", () => applyTextSize(DEFAULT_TEXT_SIZE)); |
| 17 | return null; |
| 18 | } |
| 19 |