New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 853548 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 10
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Dark theme variant support for Crostini

Project Member Reported by reve...@chromium.org, Jun 17 2018

Issue description

Some Linux apps prefer a dark theme variant. They set this to true: https://developer.gnome.org/gtk3/3.2/GtkSettings.html#GtkSettings--gtk-application-prefer-dark-theme

This doesn't work with the default crostini theme.
 

Comment 1 by jopra@chromium.org, Jun 18 2018

Status: Assigned (was: Untriaged)
Thanks Reveman,

Would love to provide a fix for this, competing priorities pushed it back.

At the moment I'm interested in targetting gnome terminal. Can you provide a list of apps you've noticed this on so I can test them also?

Cheers,
Josh
I know Tilix supports it. I think recent versions (gtk3-based) of Electron apps (E.g. VS Code) also support it and sublime text does. However, except for tilix, these still rely X11 so I'll need to update sommelier to respect this too for the titlebar to change color. I'll put up a patch for that.
I think you can also test it for all gtk3 apps by setting gtk-application-prefer-dark-theme = true

Comment 4 by jopra@chromium.org, Jun 19 2018

Thanks, GTK3 support shouldn't be too difficult (We can add a gtk-dark.css with a different color set as a minimal fix).
I don't currently know how to fix this is GTK2 (and therefore current Electron).

I'll follow this up.
Don't worry about GTK2, that's not going to work afiact. This is only for GTK3. Electron apps are switching to GTK3 and that's where we care about this working. 

GTK3 doesn't mean that Wayland and CSD are necessarily used. Electron (chromium linux) has support for GTK3 but only when using X11, not wayland. That's why we need the sommelier change so titlebars for GTK3-X11 apps match the theme.
Project Member

Comment 6 by bugdroid1@chromium.org, Jun 19 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/aade9859c6d291aa035572623ac8ae8b2c259368

commit aade9859c6d291aa035572623ac8ae8b2c259368
Author: David Reveman <reveman@chromium.org>
Date: Tue Jun 19 21:38:48 2018

vm_tools: sommelier: dark theme variant support

Respect _GTK_THEME_VARIANT property. We were always setting the
frame colors prior to this and now we're making that more explicit,
while supporting the theme variant property.

BUG= chromium:853548 
TEST=xprop -f _GTK_THEME_VARIANT 8u -set _GTK_THEME_VARIANT "dark"

Change-Id: I34f8410cc1df804dc9029972b02421fcf41ab177
Reviewed-on: https://chromium-review.googlesource.com/1104306
Commit-Ready: David Reveman <reveman@chromium.org>
Tested-by: David Reveman <reveman@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>

[modify] https://crrev.com/aade9859c6d291aa035572623ac8ae8b2c259368/vm_tools/sommelier/sommelier.c
[modify] https://crrev.com/aade9859c6d291aa035572623ac8ae8b2c259368/vm_tools/sommelier/sommelier.h
[modify] https://crrev.com/aade9859c6d291aa035572623ac8ae8b2c259368/vm_tools/sommelier/sommelier.gyp

Best test app for gtk3 theme is probable gtk3-demo-application. Instructions:

$ sudo apt-get install gtk-3-examples
$ gtk3-demo-application

Preferences -> "Prefer Dark Theme"
Cc: reve...@chromium.org sgabr...@chromium.org
sgabriel@, what would be the preferred titlebar color for a dark theme variant? sommelier is using #121D23 for now. 
New Chrome incognito uses #323639, we can probably use that.
Sgtm. Created https://chromium-review.googlesource.com/c/chromiumos/platform2/+/1113517 to make that adjustment.
Project Member

Comment 11 by bugdroid1@chromium.org, Jun 25 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/5c9f3dbb96d01fb291938b492df943bb36f6a8cc

commit 5c9f3dbb96d01fb291938b492df943bb36f6a8cc
Author: David Reveman <reveman@chromium.org>
Date: Mon Jun 25 17:52:53 2018

vm_tools: sommelier: adjust dark theme frame color

Use the same dark theme frame color by default as incognito
windows.

This also adds missing checks to ensure that frame colors are
defined during build.

BUG= chromium:853548 
TEST=xprop -f _GTK_THEME_VARIANT 8u -set _GTK_THEME_VARIANT "dark"

Change-Id: I885d1d58055af86f8d5b4f7cf5f57458139c971d
Reviewed-on: https://chromium-review.googlesource.com/1113517
Commit-Ready: David Reveman <reveman@chromium.org>
Tested-by: David Reveman <reveman@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>

[modify] https://crrev.com/5c9f3dbb96d01fb291938b492df943bb36f6a8cc/vm_tools/sommelier/sommelier.c
[modify] https://crrev.com/5c9f3dbb96d01fb291938b492df943bb36f6a8cc/vm_tools/sommelier/sommelier.gyp

Project Member

Comment 12 by bugdroid1@chromium.org, Jul 9

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/cros-adapta/+/9e72c457eaf06eaabaca8c41516750c9381680c8

commit 9e72c457eaf06eaabaca8c41516750c9381680c8
Author: Josh Pratt <jopra@chromium.org>
Date: Mon Jul 09 04:23:24 2018

Add CrosAdapta:dark theme variant

- Adds a new gtk-3.0/colors-dark.css that sets a dark colors scheme.
- Adds a new gtk-3.*/gtk-dark.css entry point that matches gtk.css but
uses the dark color scheme.

The theme_bg_color has been set to "#323639", the Chrome Incognito background
color.

The rest of the dark color scheme is a copy of the light color scheme
but swaps the core colors with their dark variant (e.g. swapping bg and fg
colors).

The specific color changes are:

- Set theme_fg_color to #cfd8dc (was #5a5a5a).
- Set theme_bg_color to #323639 (was #f2f2f2).
- Set theme_text_color to #f2f2f2 (was #202124).
- Set theme_inverted_fg_color to #5a5a5a (was #cfd8dc).
- Set theme_base_color to #202124 (was #ffffff).

Bug:  853548 
Change-Id: If8fc2bd49a754ebe8eab518fa130a40554737942
Reviewed-on: https://chromium-review.googlesource.com/1126692
Commit-Ready: Josh Pratt <jopra@chromium.org>
Tested-by: Josh Pratt <jopra@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>

[add] https://crrev.com/9e72c457eaf06eaabaca8c41516750c9381680c8/gtk-3.22/gtk-dark.css
[add] https://crrev.com/9e72c457eaf06eaabaca8c41516750c9381680c8/gtk-3.0/gtk-dark.css
[add] https://crrev.com/9e72c457eaf06eaabaca8c41516750c9381680c8/gtk-3.0/colors-dark.css

Status: Fixed (was: Assigned)
https://chromium-review.googlesource.com/1126692 should resolve this bug.

The dark theme can be used in gnome-terminal by changing the theme variant preference, globally using gnome-tweak-tool or via gsettings.
Adding a screenshot of gnome-terminal for later reference.
Screenshot 2018-07-10 at 10.53.16 AM.png
131 KB View Download
Labels: Proj-Containers

Sign in to add a comment