-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add command to toggle between light/dark color themes #151554
Add command to toggle between light/dark color themes #151554
Conversation
@Balastrong Thanks for the PR, it's nicely done! From reading your issue I was thinking of a command that doesn't need to show a quick pick dialog, but just toggles the theme to the opposite color scheme. So if the current theme is a light theme, it would switch to the preferred dark theme. If it's a dark high contrast theme, it would go to the preferred light high contrast theme. What do you think of that? |
Thank you for the feedback! You're right, I went a little bit out of scope but since there are actually four preferred themes I though it would make sense to let you quickly switch between all of them. If you think it would be more beneficial to just toggle between dark and light with the first command I can easily convert the current code to get that behavior. |
Let's ask @AllanDaemon who filed the original issue (I just realised it's not you) What do you think of that? |
Exactly. So I can assign a keybind and switch it as fast as a shortcut, just like other implementations. While this PR doesn't implement it, it's an advancement regarding this issue, improving the today's main reason of pain, and I see it filling up others user cases gaps. |
I can rename the implemented feature to something like Switch preferred theme and add a new proper Toggle preferred theme which toggles between light and dark, by keeping whether it's hc or not. Does it make sense? |
I'm ok with adding the toggle light/dark theme command, but I don't want add the one with the quick pick. |
Ok so if a light theme is detected switches to preferred dark and vice versa. What do we want to do with high contrast? |
(b) |
… high-contrast counterparts
Thank you! Code and PR description updated :) |
src/vs/workbench/services/themes/browser/workbenchThemeService.ts
Outdated
Show resolved
Hide resolved
* Added quick input action to toggle between preferred color themes * Removed quickpick in favor of command to toggle between ligh/dark and high-contrast counterparts * Moved toggle logic to themes.contribution * togglePreferredTheme -> toggleLightDarkThemes Co-authored-by: Leonardo Montini <leonardo.montini@lab.flowing.it> Co-authored-by: Martin Aeschlimann <martinae@microsoft.com>
This PR fixes #151466
This PR adds a new command that allows to toggle between dark and light theme.
If the current theme is high-contrast, it will toggle to the high-contrast counterpart.