feat: Add keyboard shortcut to toggle theme (#11127)

closes #11122
This commit is contained in:
Tom Moor authored and GitHub committed 2026-01-10 12:28:20 -05:00
1 parent 8d5b9b6ac4
commit cd84ca2fa6
2 files changed
+17 -1

No files matched your search

+16 -1
View File
@@ -25,6 +25,21 @@ export const changeToLightTheme = createAction({
perform: ({ stores }) => stores.ui.setTheme(Theme.Light),
});
export const toggleTheme = createAction({
name: ({ t }) => t("Toggle theme"),
analyticsName: "Change theme",
iconInContextMenu: false,
icon: ({ stores }) =>
stores.ui.resolvedTheme === "light" ? <MoonIcon /> : <SunIcon />,
keywords: "theme light day",
section: SettingsSection,
shortcut: ["Meta+Shift+l"],
perform: ({ stores }) =>
stores.ui.setTheme(
stores.ui.resolvedTheme === "light" ? Theme.Dark : Theme.Light
),
});
export const changeToSystemTheme = createAction({
name: ({ t }) => t("System"),
analyticsName: "Change to system theme",
@@ -47,4 +62,4 @@ export const changeTheme = createActionWithChildren({
children: [changeToLightTheme, changeToDarkTheme, changeToSystemTheme],
});
export const rootSettingsActions = [changeTheme];
export const rootSettingsActions = [changeTheme, toggleTheme];
@@ -147,6 +147,7 @@
"Download revision": "Download revision",
"Dark": "Dark",
"Light": "Light",
"Toggle theme": "Toggle theme",
"System": "System",
"Appearance": "Appearance",
"Change theme": "Change theme",