Skip to content
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

Initial dark theme support #451

Merged
merged 9 commits into from Jun 4, 2019

Conversation

Projects
None yet
3 participants
@tresf
Copy link
Contributor

commented May 22, 2019

Adds initial Dark Mode support for Windows, macOS and Linux.

image

Caveats:

  • Due to an upstream bug (https://bugs.openjdk.java.net/browse/JDK-8214131), the title bars are still Light Mode themed.
  • Windows 10 has scaling issues, bug report filed against a (more recent) fork here: bobbylight/Darcula#5
  • A (benign) illegal access exception will show in the logs for Java 9 and higher.
    Edit: Fixed by switching to bobbylight/Darkula fork.

tresf added some commits May 22, 2019

Add home for Gdk calls
Also fixes window placement bugs introduced with JDK11
@tresf

This comment has been minimized.

Copy link
Contributor Author

commented Jun 3, 2019

With exceptions of a few color choices, Ubuntu 18.04 seems to handle the dark-mode theme for Java just fine without using Darkula theme. Will patch the PR to handle this scenario.

image

@tresf

This comment has been minimized.

Copy link
Contributor Author

commented Jun 3, 2019

@Vzor- I'm testing with Adwaita-dark on Ubuntu 18.04 and for some reason the Gdk JNA code fails and never shows the "Approve" dialog.

If I comment-out DPI.getDPI(); the issue does NOT occur.

(java:13526): GLib-GObject-WARNING **: 13:57:36.177: cannot register existing type 'GdkDisplayManager'
(java:13526): GLib-CRITICAL **: 13:57:36.177: g_once_init_leave: assertion 'result != 0' failed
(java:13526): GLib-GObject-CRITICAL **: 13:57:36.177: g_object_new_with_properties: assertion 'G_TYPE_IS_OBJECT (object_type)' failed

Edit: Fixed by detecting the Gtk2/Gtk3.

Show resolved Hide resolved src/qz/utils/DPI.java Outdated

tresf added some commits Jun 4, 2019

- Detect Gtk scaling factor (Gtk2, Gtk3)
- Add theme support for Adwaita-dark (Ubuntu)
@bberenz
Copy link
Member

left a comment

Some really minor things. The code looks good otherwise.

Show resolved Hide resolved src/qz/utils/GtkUtilities.java Outdated
Show resolved Hide resolved src/qz/utils/GtkUtilities.java Outdated
Show resolved Hide resolved src/qz/ui/LinkLabel.java Outdated
@tresf

This comment has been minimized.

Copy link
Contributor Author

commented Jun 4, 2019

All comments addressed.

@tresf tresf merged commit 7ff0d04 into 2.0 Jun 4, 2019

0 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details

@tresf tresf deleted the darkmode branch Jun 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.