-
Notifications
You must be signed in to change notification settings - Fork 888
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
System theme preference #1800
System theme preference #1800
Conversation
Head branch was pushed to by a user without write access
Haven't looked at your PR yet but this might be useful to look at #1318 (comment) |
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
This PR is ready, I need this to be tested on several platforms in order to confirm 100% but after looking through vscode source code and discussing with Electron folk it seems this solution is good enough for coverage of all platforms. Needs to be checked on:
Ideally we'd check it on a few different OS versions. @ChunkyProgrammer @efb4f5ff-1298-471a-8973-3d47447115dc could you test on your respective platforms and let me know if this works? Go to settings -> Change to "system" theme -> Use your operating system settings to change back/forth from dark mode -> app should flip between light/dark theme respectively There is one known bug to me: If the system theme changes while the app is starting up there is a window where the app will not update the theme. This is due to the electron checks before registering the ipcRenderer listener. Not sure if there is a clean way of fixing it right now. |
Will start reviewing within a few hours |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, but on my current PC setup my system theme preference is broken so I cannot test :<
Looks quite good to me. Tested on ubuntu 20.04. One thing i would like to see changed tho is in this PR #1502 we introduced a black screen before the theme loads. Before that it was a white screen and when u had black theme enabled and started the app u would get flashbanged by the white flash so we opted to go for a black background so it wouldn't impact users that much. So it would be nice if the white background persisted if the light theme in system is enabled so the user doesnt see that weird black background for a sec. Im not sure if we can only change it tho. I would also go for moving the system setting to the top in the dropdown. Sound more logical to me. To keep the name uniform through the app please rename system to System Default |
Head branch was pushed to by a user without write access
use lint |
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
Coming back to this now, something weird is going on with localStorage persistence on my machine. I am unable to really test anything as the theme settings are being reset on every launch (tested on development and it happens to me there too). Any idea what might be causing this? Otherwise this PR is ready for another round of reviews. |
This is fixed now, took me a while to get it right but here is the gist of what was happening:
This was also combined with the fact that Taking out the hardcoded values in the body element makes it transparent, so it takes whatever electron is setting as the background color. I also added a v-if statement to the actual app element itself for it to wait for the user settings to be loaded to avoid any future un-styled rendering. That's about it, @efb4f5ff-1298-471a-8973-3d47447115dc cheers for finding that I think I was staring at the windows too much and it never occurred to me that it was happening! Always thankful for your testing! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Apologies for the wait!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested briefly locally, reviewed code
Only got 1 concern (see line comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can always change it back if people complain...
Seems like this is close to being done. I'm excited! |
@PrestonN would you be able to take a look at this one, it's either ready to go or very close to. Just need some more eyes on it I guess. Cheers. |
Hi @vallode apologies for the wait. Preston is unavailable this week, will be back next week. Our plan is to do a release with allot of fixes. After that release we will merge over all the PRs that are ready to go including this one. If u want we could maybe include this pr is our next release. |
I'm biased to say this would be a great addition to a release, haha! Whatever you decide, I'm around to make sure I can do some fixes if/when they come up for the release. No need to apologise at all! Looking forward to the release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
Hi there @vallode. I was looking through the project today and noticed that there was a small error occurring where it was trying to look for a Thanks! |
We're all good @PrestonN, I had a look but I remember using setBodyTheme for an earlier implementation of this feature. Not needed and thanks for fixing my mistake! |
System theme preference
Pull Request Type
Related issue
Closes #691
Closes #2106
Closes #2092
Description
Adds a new theme "system" that will match your OS's preferred color scheme (light/dark) dynamically** (see additional notes)
Screenshots (if appropriate)
Please add before and after screenshots if there is a visible change.
Testing (for code that is not small enough to be easily understandable)
Open the app and switch your OS theme from light to dark and vice-versa to test the change.
Desktop (please complete the following information):
Additional context
**The dynamic nature of this currently does not work at all on my system (GTK 3 Gnome) but I am debugging it with some electron folks over at their discord server. Hoping this will be fixed soon but I am opening the PR to have it ready.
If you could test this out on Windows/Mac to see if the behaviour is already working there that'd be great :)
I'm also aware I need to add the fields to all translations, I just left it out until I can confirm things work