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

Problems with dark Adwaita theme in Gtk 3.14 #100

Closed
majutsushi opened this Issue Sep 27, 2014 · 6 comments

Comments

Projects
None yet
2 participants
@majutsushi

majutsushi commented Sep 27, 2014

I am using the dark variant of the default Adwaita theme (by setting gtk-application-prefer-dark-theme = true). This worked fine until recently, but after upgrading to the new 3.14 release of Gtk the content section of a feed is now displayed as white-on-white:

liferea-dark

Here is the output from liferea --debug-html:

HTML   : theme color "GTK-COLOR-FG" is EEEEEC
HTML   : theme color "GTK-COLOR-BG" is 393F3F
HTML   : theme color "GTK-COLOR-LIGHT" is 495353
HTML   : theme color "GTK-COLOR-DARK" is 282B2B
HTML   : theme color "GTK-COLOR-MID" is 383F3F
HTML   : theme color "GTK-COLOR-BASE" is FFFFFF
HTML   : theme color "GTK-COLOR-TEXT" is EEEEEC
HTML   : theme color "GTK-COLOR-NORMAL-LINK" is 184472
HTML   : successfully set the color for links
HTML   : theme color "GTK-COLOR-VISITED-LINK" is 184472
HTML   : successfully set the color for visited links
HTML   : Dark GTK theme detected.
HTML   : Feed list unread CSS: foreground='#393F3F' background='#EEEEEC'
@lwindolf

This comment has been minimized.

Owner

lwindolf commented Oct 1, 2014

Ok, the issue is Liferea using the following CSS (color names are replace before applying with the values as in the debug trace).

body {
    background: #GTK-COLOR-BASE;
    color: #GTK-COLOR-TEXT;
    padding:0;
    margin:0;
}
@lwindolf

This comment has been minimized.

Owner

lwindolf commented Oct 1, 2014

I actually tend to say the usage of "base" color for background is correct. The theme is at fault for example here https://wiki.gnome.org/Attic/GnomeArt/Tutorials/GtkThemes it says "base" is the color of text widgets which of course use "text" for foreground.

@lwindolf lwindolf self-assigned this Oct 1, 2014

@majutsushi

This comment has been minimized.

majutsushi commented Oct 1, 2014

I wonder if there are any relevant differences between Gtk 2 and 3 concerning the use of "base" names. Here is the actual CSS of the theme (it gets compiled into Gtk as it is the default theme now):
https://git.gnome.org/browse/gtk+/tree/gtk/resources/theme/Adwaita/gtk-contained-dark.css

I searched through it for "base" references and uses of "ffffff" but I didn't find anything obvious that would explain the issue.

@lwindolf

This comment has been minimized.

Owner

lwindolf commented Oct 11, 2014

Dark Adwaita for GTK 3.10 (Ubuntu 12.04 LTS) is

HTML   : theme color "GTK-COLOR-FG" is EEEEEC
HTML   : theme color "GTK-COLOR-BG" is 393F3F
HTML   : theme color "GTK-COLOR-LIGHT" is 495353
HTML   : theme color "GTK-COLOR-DARK" is 282B2B
HTML   : theme color "GTK-COLOR-MID" is 383F3F
HTML   : theme color "GTK-COLOR-BASE" is 333333
HTML   : theme color "GTK-COLOR-TEXT" is FFFFFF
HTML   : theme color "GTK-COLOR-NORMAL-LINK" is 4A90D9

Testing with the different dark, medium dark and light themes in GTK 3.10 I found there is no safe middle ground (e.g. by using GTK-COLOR-BG as background). There needs to be a brightness distance check and if it fails Liferea needs to use black or white for text depending on what makes best contrast.

@lwindolf lwindolf added the bug label Oct 11, 2014

@lwindolf lwindolf added this to the 1.10.12 milestone Oct 11, 2014

lwindolf added a commit that referenced this issue Oct 11, 2014

@lwindolf

This comment has been minimized.

Owner

lwindolf commented Oct 11, 2014

I added some mad color brightness calculations to 1.10 branch. @majutsushi Could you please test those?

lwindolf added a commit that referenced this issue Oct 14, 2014

@lwindolf lwindolf closed this Oct 14, 2014

@majutsushi

This comment has been minimized.

majutsushi commented Oct 26, 2014

Sorry for the late reply, I didn't have time to compile and test it until now. I does seem to be fixed now, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment