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 735368 - try to tidy up the TextView background rendering
try to tidy up the TextView background rendering
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
3.13.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 733606
 
 
Reported: 2014-08-25 09:51 UTC by Paolo Borelli
Modified: 2014-08-26 07:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (3.57 KB, patch)
2014-08-25 09:51 UTC, Paolo Borelli
accepted-commit_now Details | Review

Description Paolo Borelli 2014-08-25 09:51:13 UTC
The margins (eg gedit's line numbers) used to be rendered with a grey background, because they used to be just rendered with the default widget color, while the actual text part used the "base" color, which is white by default.

Things got mixed up over time, with the ".view" class also applied to the main widget window and with the margins using code to fetch the color from the style context and then setting it explicitly on on the GdkWindow

The attached patch tries to address it, and with the patch gedit's line numbers are back to what they used to be.

However once I create a new tab they go back to be white... my suspicion is that now margins are simply drawn "transparent" and for some reason we end up with "white" showing through. If in the inspector I explicitly do:

GtkTextView {
  background: grey;
}

GtkTextView.view {
  background: white;
}

then things seems to be fine, but I am not sure if this should be fixed by fixing the theme or if there is some other bug
Comment 1 Paolo Borelli 2014-08-25 09:51:54 UTC
Created attachment 284388 [details] [review]
patch
Comment 2 Ignacio Casal Quinteiro (nacho) 2014-08-25 10:01:40 UTC
Review of attachment 284388 [details] [review]:

The patch looks good to me.
Comment 3 Paolo Borelli 2014-08-26 07:58:49 UTC
pushed with a little more cleanup.

The remaining problem with line numbers in gedit is due to gtknotebook:

1) adwaita sets the notebook bg to base_bg_color instead of bg_color which sounds wrong to me

2) notebook paints the bg only if there is more than a tab which is definitely wrong