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 732300 - No longer easy to distinguish painted from unpainted squares
No longer easy to distinguish painted from unpainted squares
Status: RESOLVED FIXED
Product: hitori
Classification: Applications
Component: General
git master
Other Linux
: Normal normal
: ---
Assigned To: Michael Catanzaro
hitori-maint
Depends on:
Blocks: 731307
 
 
Reported: 2014-06-26 21:46 UTC by Michael Catanzaro
Modified: 2014-07-07 00:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use CSS provider to control colors used in UI (7.44 KB, patch)
2014-07-05 18:21 UTC, Michael Catanzaro
needs-work Details | Review
Use CSS provider to control colors used in UI (7.60 KB, patch)
2014-07-06 16:24 UTC, Michael Catanzaro
none Details | Review
Use CSS provider to control colors used in UI (7.91 KB, patch)
2014-07-06 16:27 UTC, Michael Catanzaro
committed Details | Review

Description Michael Catanzaro 2014-06-26 21:46:24 UTC
I guess due to Adwaita changes, with the latest GTK+ it's no longer easy to see which squares are painted and which are not -- the numbers become smaller, but that's it.
Comment 1 Philip Withnall 2014-06-26 22:29:37 UTC
This is something which has been on my list for a little while: the drawing code should be modified to use a GtkCssProvider to provide its colours. They can then come from a custom CSS file which could be customised for different themes (if necessary).

Currently the tag colours are hard-coded, and the cells themselves use the default GtkStyleContext background colours for the default and insensitive widget states. I guess those two colours have been changed to be the same in GTK+.
Comment 2 Michael Catanzaro 2014-07-05 18:21:29 UTC
Created attachment 279958 [details] [review]
Use CSS provider to control colors used in UI

This style looks the same as Hitori using Adwaita prior to GTK+ 3.13.3
Comment 3 Philip Withnall 2014-07-06 12:23:01 UTC
Review of attachment 279958 [details] [review]:

This looks good to me apart from the one comment below.

Ideally, the grid would be rearchitected as a GtkWidget subclass, and the CSS would be rearranged to use properties, rather than defined colours. Then the defines like BORDER_LEFT and *_FONT_SCALE could be moved into the CSS file too. That can be done as a separate bug at some point in the future though.

::: src/interface.c
@@ +204,3 @@
 	if (hitori->board[iter.x][iter.y].status & CELL_TAG1) {
+		lookup_color (style_context, "tag1-color", &colour);
+		colour.alpha = painted ? PAINTED_ALPHA : NORMAL_ALPHA;

I think the alphas should be defined in the CSS file.
Comment 4 Michael Catanzaro 2014-07-06 16:24:02 UTC
(In reply to comment #3)
> Ideally, the grid would be rearchitected as a GtkWidget subclass, and the CSS
> would be rearranged to use properties, rather than defined colours. Then the
> defines like BORDER_LEFT and *_FONT_SCALE could be moved into the CSS file too.
> That can be done as a separate bug at some point in the future though.

That would be best. I was worried that would be the only way to fix this. (I wasn't keen on doing that work.)

> ::: src/interface.c
> @@ +204,3 @@
>      if (hitori->board[iter.x][iter.y].status & CELL_TAG1) {
> +        lookup_color (style_context, "tag1-color", &colour);
> +        colour.alpha = painted ? PAINTED_ALPHA : NORMAL_ALPHA;
> 
> I think the alphas should be defined in the CSS file.

Definitely.
Comment 5 Michael Catanzaro 2014-07-06 16:24:24 UTC
Created attachment 279997 [details] [review]
Use CSS provider to control colors used in UI

This style looks the same as Hitori using Adwaita prior to GTK+ 3.13.3
Comment 6 Michael Catanzaro 2014-07-06 16:27:33 UTC
Created attachment 279998 [details] [review]
Use CSS provider to control colors used in UI

This style looks the same as Hitori using Adwaita prior to GTK+ 3.13.3
Comment 7 Philip Withnall 2014-07-06 22:53:39 UTC
Review of attachment 279998 [details] [review]:

Go for it.
Comment 8 Michael Catanzaro 2014-07-07 00:26:16 UTC
Attachment 279998 [details] pushed as 9effdc2 - Use CSS provider to control colors used in UI