mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-21 23:50:45 +00:00
Auto-detects default hotkey scheme by platform
Improves user experience by setting the default hotkey scheme based on the user's operating system, ensuring better alignment with platform conventions.
This commit is contained in:
1 file changed
+5
-1
@@ -20,7 +20,11 @@ const DEFAULT_COLOR = '221.2 83.2% 53.3%';
|
||||
const DEFAULT_THEME: 'light' | 'dark' = 'light';
|
||||
const DEFAULT_TERMINAL_THEME = 'netcatty-dark';
|
||||
const DEFAULT_FONT_FAMILY = 'menlo';
|
||||
const DEFAULT_HOTKEY_SCHEME: HotkeyScheme = 'mac';
|
||||
// Auto-detect default hotkey scheme based on platform
|
||||
const DEFAULT_HOTKEY_SCHEME: HotkeyScheme =
|
||||
typeof navigator !== 'undefined' && /Mac|iPhone|iPad|iPod/i.test(navigator.platform)
|
||||
? 'mac'
|
||||
: 'pc';
|
||||
|
||||
const applyThemeTokens = (theme: 'light' | 'dark', primaryColor: string) => {
|
||||
const root = window.document.documentElement;
|
||||
|
||||
Reference in new issue
Block a user