diff --git a/app/actions/definitions/settings.tsx b/app/actions/definitions/settings.tsx index 9a76c42f65..9b6eed0e62 100644 --- a/app/actions/definitions/settings.tsx +++ b/app/actions/definitions/settings.tsx @@ -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" ? : , + 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]; diff --git a/shared/i18n/locales/en_US/translation.json b/shared/i18n/locales/en_US/translation.json index 48d1e91d7e..03d32cd05a 100644 --- a/shared/i18n/locales/en_US/translation.json +++ b/shared/i18n/locales/en_US/translation.json @@ -147,6 +147,7 @@ "Download revision": "Download revision", "Dark": "Dark", "Light": "Light", + "Toggle theme": "Toggle theme", "System": "System", "Appearance": "Appearance", "Change theme": "Change theme",