-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 Light style option to Application style #2558
Comments
For future reference, this would be straightforward if the following is implemented in our used style sheet: ColinDuquesnoy/QDarkStyleSheet#240 |
Thanks to a new light style provided by QDarkStyleSheet in v3.0.rc (9eea545) we can add a new light style option. `qdarkstyle/dark/style.qrc` had to be renamed to `qdarkstyle/dark/darkstyle.qrc` and `qdarkstyle/light/style.qrc` to `qdarkstyle/light/lightstyle.qrc` in order to include both as resources. See issues: - ColinDuquesnoy/QDarkStyleSheet#240 - ColinDuquesnoy/QDarkStyleSheet#273 - #2558
Thanks to ColinDuquesnoy/QDarkStyleSheet, which provides now a light style, I could implement a new option for a light style. @ThomasBallatore could you try with tomorrow's nightly build and report any problem in your environment? |
Hey, this is great—thanks! I tested the April 1st nightly build on my mac (MacBookPro15,3 running 20E5224a) and wanted to clarify a few things I'm seeing. When I select Preferences | General | Application style | Follow the desktop style, I see this when my Mac is in Light mode: and this when my Mac is in Dark mode: In DB Browser for SQLite, when I choose Light style, I see this: and for Dark style, this: While these latter two certainly look nice, I guess I was hoping for an option to simply show one of the first two by selecting something like light or dark in DB Browser. One issue, esp. with the new Light style, is the lower contrast. Also, it looks like the font size got tweaked to something a bit tiny for my aging eyes. |
The rationale of this is that we follow your desktop style by default and we adjust our defined colours to match the lightness or darkness of it. Additionally we provide a particular style, now in two shades, light and dark. I don't know if one can choose the native style with a different shade as the desktop. Why do you need it to be different? Cannot the font be changed from Preferences? |
Ideally, what I was looking for is the ability to just keep DB Browser in Light mode even if my computer is in Dark mode. In my 4 screenshots above, that means #1, all the time. When teaching at night, I find it much better for students if I share my screen with DB Browser in Light mode (other programs are different). #3 and #1 look quite different to me and I suspect many will prefer the nice #3 but for me, #1 is more readable. As for font size, I'm guessing something odd happened behind the scenes with the Light style (#3)'s font size because I took these screenshots at the same time with no other settings changing. Thanks again for all your work on this awesome product! |
Can you just confirm changing the value in the preferences changes the font size? It may be that the style isn't looking at the right value, for example. |
Just restarted and can confirm the font size is now fine without any adjustment. Just a glitch in the matrix before! |
@mgrojo - I don't know how Qt works, but do we say 'use dark theme' and set the colours for each component/widget explicitly, or just tell Qt to use 'light' and 'dark' and it does what it wants? This was globally across all applications, but it could be good to define something for DB4S along these lines? That way, 'dark mode' could be anything the user wanted - bit darker, bit lighter, etc... |
Thanks for confirming! 👍 |
When we set 'Dark style' or 'Light style, we use https://github.com/ColinDuquesnoy/QDarkStyleSheet/, which is a style-sheet that sets the colors and appearance for all the widgets, except for the colours of the data browser and SQL editor. Since we let the user configure those, we have to adjust them to dark or light combinations, when the general style is selected. In the 'Follow Desktop' setting we have to discover whether it's light or dark, in order to adjust those configurable colours to the style (so the user always get good defaults). This is what I was referring to.
I suppose it could be done, but I suppose it's going too far. Maybe for the editor, we could define different selectable themes, like many editors do, but the majority of applications do not allow changing the widget style independently. |
Maybe you can force the light mode using OS ways. In this commit we reverted the previous forcing of the light mode for macOS (till then we had some problems with the dark mode): Maybe you can change that file yourself without recompiling? I'm not sure since I don't know macOS. And in this article, it seems that you can exclude some application from the dark mode: |
Follow the desktop style does not change theme to dark on my windows 10 machine, when system is set to dark. |
@rafrafek - What version of DB4S are you using? Have you tried with the nightly version at all? |
3.12.2
I'm sorry, I didn't try the nightly version.
It doesn't work dynamically.
Yes, and it doesn't work after DB4S restart.
All the other apps I use do the flip immediately. It would be a nice option. |
All? Notepad doesn't. ;) Considering it's job is to maintain databases, it seems weird it'd have to waste CPU cycles determining if the user has changed from light to dark theme. Do you switch themes often then? |
I don't use notepad. I use VS Code, PyCharm, Outlook, Edge, Firefox etc., all of them change theme automatically.
Can you just subscribe to system event or something like that?
Twice a day. Light in the morning, dark in the evening. |
Qt is cross platform, so it's whether it passes on information from macOS, Windows or a plethora of Linux distributions. The issue is tagged as an enhancement already, so hopefully it can be looked into. |
I've discovered a problem with the dark and light styles (not the desktop style) and I'll add it here, since it is still open. A second click in a column to revert the sort order causes the column headers to disappear. The problem disappears with a refresh. I returned to d123fc9 in order to know if the last changes were responsible, but no, it is something older, maybe after the stylesheet update for this issue. |
Ouch. Good catch though @mgrojo. 😄 |
This happened only for the custom dark/light styles. The new connects fixes the issue for me. This was discovered by trial and error, because I don't know what is really causing the problem (seems some bug relating with event ordering and maybe a race condition). Second change is irrelevant for the issue, just for optimization of the loop. See comment: #2558 (comment)
The problem I mentioned should be fixed now, at least it's working for me. |
Excellent effort @mgrojo! 😄 |
This happened only for the custom dark/light styles. The new connects fixes the issue for me. This was discovered by trial and error, because I don't know what is really causing the problem (seems some bug relating with event ordering and maybe a race condition). Second change is irrelevant for the issue, just for optimization of the loop. See comment: #2558 (comment)
This fixes at least a problem in display of combo-boxes. Updated following instructions in: https://github.com/ColinDuquesnoy/QDarkStyleSheet/tree/v3.2.1#c - Related issue: #2558. - Issue still present (no difference in toggled buttons in menus): #1899.
Describe the new feature
The new feature would add an option for "Light style" to the existing choices of "Dark style" and "Follow the desktop style" to Application style in the General tab under Preferences.
This would allow users to have their desktop style set to Dark but to still be able to use DB Browser for SQLite in Light mode.
Additional info
Please answer these questions before submitting your feature request.
Is your feature request related to an issue? Please include the issue number.
No.
Does this feature exist in another product or project? Please provide a link.
Yes. For example, Discord as shown in following screenshot.
Do you have a screenshot? Please add screenshots to help explain your idea.
The menu bar above shows the system is in Dark mode but the app itself is in Light mode. While I love the new Dark mode in DB Browser for SQLite when working alone, I prefer Light mode when teaching and sharing my screen but do not want to change my system settings to Light mode because I prefer other apps to stay in Dark mode.
The text was updated successfully, but these errors were encountered: