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

An option to switch into a Dark theme would be very useful #1324

Closed
m4heshd opened this Issue Feb 20, 2018 · 24 comments

Comments

Projects
None yet
3 participants
@m4heshd
Copy link

m4heshd commented Feb 20, 2018

Details for the issue

In my experience most of the developers are night owls and keep looking at screens for about 16 hours a day. In my case i have a 2nd monitor where i have sqlitebrowser open pretty much all the time. Since i have to look at the light colored window all the the time it makes my eyes hurt in a little while. I use this tool a lot. So it would be amazing if it's possible to switch to a Dark theme.

Useful extra information

I'm opening this issue because:

  • DB4S is crashing
  • DB4S has a bug
  • DB4S needs a feature
  • DB4S has another problem

I'm using DB4S on:

  • Windows: ( version: ___ )
  • Linux: ( distro: ___ )
  • Mac OS: ( version: ___ )
  • Other: ___

I'm using DB4S version:

  • 3.10.1
  • 3.10.0
  • 3.9.1
  • Other: ___

I have also:

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Feb 21, 2018

As a thought, it seems like windows can set any application to a dark theme:

    http://troubleshooter.xyz/wiki/enable-dark-theme-for-every-application-in-windows-10/

The "Enable a Dark Theme for Windows Desktop Applications" section on that page shows how. I just did similar for a Windows 7 desktop here to try it, and it seems to work. 😄

@m4heshd

This comment has been minimized.

Copy link
Author

m4heshd commented Feb 21, 2018

Hi Justin. The problem is only method that works with DB4S is if you change the default Windows colors which ruins the experience of windows. I'm already using windows Dark mode and tried all of these before. I've even tried better ones like this.

DB4S looks like this when i use the above theme which is OK but not perfect. Lots of missing texts and random white backgrounds.

image

Also this messes up all other applications. It'll be really good if there's a native option for the theme in the app.

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Feb 22, 2018

No worries, that definitely makes sense. To me anyway. 😄

@m4heshd

This comment has been minimized.

Copy link
Author

m4heshd commented Feb 24, 2018

Thank you for understanding.

@justinclift justinclift added the windows label Feb 24, 2018

@mgrojo mgrojo self-assigned this Feb 25, 2018

mgrojo added a commit that referenced this issue Feb 25, 2018

Support for dark themes in default settings and restore defaults button
All the colour configurations have been reviewed under an operating-system theme
dark theme.

Some hard-coded colours in QScintilla editors and Data Browser have been
replaced by queries of the system palette or reuse of our settings.

New settings for foreground and background colours for QScintilla editors
defaulting to system colours. This is mainly needed because if the user
saves colour settings for a dark theme and then he changes the system theme
back to a light theme, then the foreground colours are preserved while the
background would fall back to the system theme leading to an incompatible
combination. This also gives more freedom to the user in defining his own
colour combinations.

Since only the default colour settings adapt to the system theme, and once
settings are saved this can no longer happen, a 'Restore Defaults' button
is added so the default adapted colour settings can be restored. This is
also useful for restoring default behaviour when wanted.

Other fixes and improvements: waiting cursor while saving; check boxes in
SQL tab for bold, italic and underline when applicable; avoid translation
of hidden colour setting names used in code.

See related issue #1324.
@mgrojo

This comment has been minimized.

Copy link
Contributor

mgrojo commented Feb 25, 2018

@m4heshd I've implemented a series of changes for a better support of operating system dark themes. If there aren't any saved settings the default colours adjust automatically to the light or dark system theme.

Would you have some time to test it in our next nightly build? https://nightlies.sqlitebrowser.org/latest/
Be sure to restore the default preferences using the new button for that purpose before taking into
account the changes or after having changed the system theme.

Your test would be specially needed since I use Ubuntu Linux and this might be very system dependent. This is an example using the Arc-dark theme in Ubuntu:
imagen

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Feb 25, 2018

Oooooooo Aaaaaaaaaa.... just tried it out with KDE (4.x) on my CentOS 7 desktop:

db4s-kde-dark_theme1

This looks pretty good @mgrojo. 😁

Haven't actually played around with KDE themes before... might stick with this dark one for a while, as I was getting kind of sick of the previous KDE look. 😉

@m4heshd The button mentioned by @mgrojo is the new "Restore Defaults" button in the Preferences dialog. It's in the bottom left, on the same level as the Save and Cancel buttons. 😄

@justinclift justinclift removed the windows label Feb 25, 2018

@m4heshd

This comment has been minimized.

Copy link
Author

m4heshd commented Feb 25, 2018

Thank you for the update. Tested it out and gotta say it looks really good. The Table component still has a white bg and i understand why that's happening. Overall it looks like this.

image

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Feb 25, 2018

@m4heshd Just to check, did you compile it yourself or did you download from our nightly builds server?

If it's the download from the nightly build server, then that only gets updated once per day (~5am UTC), so it won't have @mgrojo's changes in it yet. 😉

@m4heshd

This comment has been minimized.

Copy link
Author

m4heshd commented Feb 25, 2018

Oops.. My bad. 😁

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Feb 25, 2018

Hmmm, once the nightly builds are ready + known to work on Windows, it's probably worth mentioning this Dark Theme support on Twitter. I'll get that done tomorrow sometime. 😄

@m4heshd

This comment has been minimized.

Copy link
Author

m4heshd commented Feb 25, 2018

Haha i was waiting to go scream on Twitter because at first i requested this feature on Twitter. Then i was advised to open the issue. Too lazy to compile. Waiting for the package 😸

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Feb 25, 2018

Heh Heh Heh

k, I've just manually started the Windows nightly build script. In roughly 30-40 minutes, updated builds will be on the nightly server. You'll want to check the date stamp first before downloading, just to make sure.

That should save waiting until tomorrow. 😀

@m4heshd

This comment has been minimized.

Copy link
Author

m4heshd commented Feb 26, 2018

Yes i was checking that and also cleared the cache to make sure.

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Feb 26, 2018

Sorry for the delay with this. The nightly build script compiled things fine, but the automatic upload failed. I've just manually uploaded the nightly builds now.

@m4heshd

This comment has been minimized.

Copy link
Author

m4heshd commented Feb 26, 2018

Yup i saw just got updated. Thank you for going for a lot of trouble.

@m4heshd

This comment has been minimized.

Copy link
Author

m4heshd commented Feb 26, 2018

Everything seems to be looking good. Colored texts are bright and all the backgrounds are dark. Thanks. ☺

image

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Feb 26, 2018

Awesome. I'll make a Twitter post about it now. Is it ok to use your screenshot in the Twitter post? (me being lazy here)

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Feb 26, 2018

Meh, I used all three of our screenshots. So, Ubuntu, CentOS, and Windows. 😄

    https://twitter.com/sqlitebrowser/status/967968416236785665

@m4heshd

This comment has been minimized.

Copy link
Author

m4heshd commented Feb 26, 2018

Everything's perfect. I wish i could get into Qt right now. I'm a huge GUI nerd even though i'm not any kind of a UI specialist. But i got my hands full with trying to migrate all of my Java Swing GUI apps to ElectronJS. Definitely going to get my hands on with Qt when this framework war is done. 😥

PS: Big thanks to @mgrojo 🙏

@mgrojo

This comment has been minimized.

Copy link
Contributor

mgrojo commented Feb 28, 2018

You're welcome @m4heshd. Now I'm using a dark theme for my desktop too 😄

@ghost

This comment has been minimized.

Copy link

ghost commented Jun 23, 2018

wait.. this means it won't work on Windows 8.1? :-o Looks great btw :)

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Jun 23, 2018

Errr... it worked on Win7 when I tested it. Kind of thinking it should work on Win 8.1 too.

You do need to click the "Restore Defaults" button (bottom left) in the Preferences dialog though, to get it to use the new theme.

@ghost

This comment has been minimized.

Copy link

ghost commented Jun 23, 2018

Sorry, I did (+restart) but still no change. :( But I'll look closer into it tomorrow as I'm probably not in a state to dig closer into it right now.

@m4heshd

This comment has been minimized.

Copy link
Author

m4heshd commented Jun 23, 2018

Worked for me on Win 10. Remember it needs a system-wide theme for this to work. Not sure if the functionality will remain after Redstone 5.

mgrojo added a commit that referenced this issue Dec 23, 2018

Improve the size policy (and more and better icons)
These changes improve the size policy for translations having long texts
in some buttons by:

* Converting the text buttons in the Edit Database Cell to icons
* Making the "Type of data" label wrappable and expandable
* Converting the text buttons in the Browse Data tab to icons
* Allowing the Plot combo-boxes to shrunk

All this allows both the Browse Data and the docks to grow and shrink with
more freedom.

New icons for buttons are reused when appropriate in context menus.

Added icon for filter and improve icon for docks (has been mirrored so it
matches the actual dock position).

Added Print icon in Edit Database Cell using the extra free space, so the
print action there is more visible.

This continues the effort started in #1324.

mgrojo added a commit that referenced this issue Feb 8, 2019

Improve the size policy (toolbars and improved icons) (#1684)
* Improve the size policy (and more and better icons)

These changes improve the size policy for translations having long texts
in some buttons by:

* Converting the text buttons in the Edit Database Cell to icons
* Making the "Type of data" label wrappable and expandable
* Converting the text buttons in the Browse Data tab to icons
* Allowing the Plot combo-boxes to shrunk

All this allows both the Browse Data and the docks to grow and shrink with
more freedom.

New icons for buttons are reused when appropriate in context menus.

Added icon for filter and improve icon for docks (has been mirrored so it
matches the actual dock position).

Added Print icon in Edit Database Cell using the extra free space, so the
print action there is more visible.

This continues the effort started in #1324.

* Convert the embedded buttons to actual toolbars

This provides more flexibility, like the way how toolbars are compacted
when they have not enough space.

The QToolButtons in Browse Data tab and in Edit Cell dialog are converted
to QActions and inserted in new toolbars embedded in the same place as
the old buttons. Everything else should stay the same (shortcuts, tool-tips
and what's-this information).

* Set style for all toolbars in Preferences and minor adjustments

The combo-box used for the main toolbar is replicated for all the toolbars
in application. In this way, users with high resolutions can use the styles
with both icons and text, while users with lower resolutions can leave the
default styles, which should be better for them.

Some icon texts has been abbreviated from their default values, so they fit
better in the toolbars when they are visible.

The print icon in Edit Cell has been moved to the right, where it would be
the first to be collapsed.

The original what's-this info for Set as NULL in Edit Cell toolbar has been
restored.

* Remove no longer used overloaded function

The addShortcutsTooltip function applying to QWidget was no longer used
after having converted all the buttons to actions, so it is removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment