After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 787531 - The tick button is not/barely visible on light colors with Dark theme
The tick button is not/barely visible on light colors with Dark theme
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Themes
3.22.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 787757
 
 
Reported: 2017-09-11 02:18 UTC by Mohammed Sadiq
Modified: 2017-09-16 16:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
color picker with dark theme (image) (10.81 KB, image/png)
2017-09-11 02:18 UTC, Mohammed Sadiq
  Details
Adwaita: dark: Make colorswatch.light tick visible (3.65 KB, patch)
2017-09-11 20:29 UTC, Daniel Boles
none Details | Review
Adwaita: dark: Make colorswatch.light tick visible (3.86 KB, patch)
2017-09-16 14:59 UTC, Daniel Boles
committed Details | Review

Description Mohammed Sadiq 2017-09-11 02:18:03 UTC
Created attachment 359488 [details]
color picker with dark theme (image)

With Adwaita dark theme, the tick button always have white color, which makes it less visible when the color is light.
Please see the attached screenshot (the top right color selected).

Thanks
Comment 1 Daniel Boles 2017-09-11 13:19:00 UTC
Good catch; this is because the CSS applies $text_color to colorswatch.light and $selected_fg_color to colorswatch.dark, but in Adwaita:dark those are both white.
Comment 2 Daniel Boles 2017-09-11 13:35:10 UTC
I would say to simplify things here, and rather than depending on $named_colours, just use white for .dark and black for .light

However, since there are backdrop selectors, we should probably do something more sophisticated...
Comment 3 Daniel Boles 2017-09-11 13:42:16 UTC
(In reply to Daniel Boles from comment #2)
> However, since there are backdrop selectors, we should probably do something
> more sophisticated...

fwiw, in this case, HighContrast just does
     &:backdrop { color: transparentize(white|black, 0.7); }

so maybe the same would work for Adwaita.


Alternatively, we could substitute $text_color with e.g. $borders_color in Adwaita:dark, but I don't know if using named colours here really gains anything.
Comment 4 Daniel Boles 2017-09-11 20:29:54 UTC
Created attachment 359557 [details] [review]
Adwaita: dark: Make colorswatch.light tick visible

It used $text_color unconditionally, but in :dark, text is white, so we
overlaid a white tick on any light colours, all the way to white itself.

Instead, just use white/black over dark/light swatches respectively,
as done by HC, so both variants get the right colour for every swatch.

--
--

Does anyone know why, whenever I regenerate the CSS from the SASS, it does stuff
like this? If I had to guess, it seems that my sassc disagrees with Jakub’s,
especially about whether to include various selectors on both :selected:focus.

--- a/gtk/theme/Adwaita/gtk-contained-dark.css
+++ b/gtk/theme/Adwaita/gtk-contained-dark.css
@@ -1852,9 +1852,9 @@ headerbar.selection-mode button.titlebutton, .titlebar.selection-mode button.tit
 
 headerbar.selection-mode button.titlebutton:backdrop, .titlebar.selection-mode button.titlebutton:backdrop { -gtk-icon-shadow: none; }
 
-.view:selected:focus, .view:selected, iconview:selected, .view text:selected, iconview text:selected, textview text:selected, .view text selection:focus, iconview text selection:focus, .view text selection, iconview text selection, textview text selection:focus, textview text selection, flowbox flowboxchild:selected, spinbutton:not(.vertical) selection, entry selection, modelbutton.flat:selected, .menuitem.button.flat:selected, treeview.view:selected:focus, treeview.view:selected, row:selected, calendar:selected { background-color: #215d9c; }
+.view:selected:focus, iconview:selected:focus, .view:selected, iconview:selected, .view text:selected:focus, iconview text:selected:focus, textview text:selected:focus, .view text:selected, iconview text:selected, textview text:selected, .view text selection:focus, iconview text selection:focus, .view text selection, iconview text selection, textview text selection:focus, textview text selection, flowbox flowboxchild:selected, spinbutton:not(.vertical) selection, entry selection, modelbutton.flat:selected, .menuitem.button.flat:selected, treeview.view:selected:focus, treeview.view:selected, row:selected, calendar:selected { background-color: #215d9c; }
Comment 5 Daniel Boles 2017-09-16 14:48:17 UTC
Review of attachment 359557 [details] [review]:

::: gtk/theme/Adwaita/_common.scss
@@ +4122,3 @@
     &:hover { border-color: if($variant == 'light', transparentize(black, 0.2), $borders_color); }
 
+    &:backdrop { color: transparentize(white, 0.7); }

Alpha of 0.5 is better here, as that's basically the current effect (because backdrop FG colour is a 50% mix of FG colour), whereas 0.7 makes the backdropped tick too faint compared to what we currently do.
Comment 6 Daniel Boles 2017-09-16 14:59:22 UTC
Created attachment 359897 [details] [review]
Adwaita: dark: Make colorswatch.light tick visible

It used $text_color unconditionally, but in :dark, text is white, so we
overlaid a white tick on any light colours, all the way to white itself.

Instead, just use white/black over dark/light swatches respectively,
as done by HC, so both variants get the right colour for every swatch.

For backdrop, use alpha 0.5, unlike 0.7 in HC, as that seemed excessive
& different from the current effect. 0.5 is almost identical to how
$backdrop_fg_colour is a 50% mix of $fg_color, & matches backdrop text.
Comment 7 Daniel Boles 2017-09-16 16:03:48 UTC
Comment on attachment 359897 [details] [review]
Adwaita: dark: Make colorswatch.light tick visible

This seems like a no-brainer, so pushed (with a slightly better commit message)