GNOME Bugzilla – Bug 764203
Default background color for the 'textview border' node
Last modified: 2016-05-27 10:57:21 UTC
In GTK+ 3.18 and below, the GtkTextView borders (left, right, top, bottom) had a different background color than the main text area. In Adwaita the borders were light gray by default. Now with GTK+ 3.20 the borders are white, like the main text area. See the screenshots of gedit 3.18 and gedit 3.20 (with the Classic color scheme) to see the difference. The Classic and Tango color schemes of GtkSourceView follow as closely as possible the GTK+ theme. It would be easy for us to define the border background color ourselves in Classic and Tango too, but it would not follow the GTK+ theme and would not use the exactly same color palette as defined in e.g. Adwaita.
Created attachment 324763 [details] gedit 3.18 with light gray background for line numbers
Created attachment 324764 [details] gedit 3.20
Fixed in both master and 3.20 branch, commits d23c6c624628d31fa7c9dd543c96af18954018c2 and 30e234d84749dea9ed137bddc2e94c8ff7fa48b7 respectively
Created attachment 325224 [details] gedit with dark color scheme with the patch There is now a white line between the border and the main text area. It is not visible with a light color scheme, and the result is better than before with a light color scheme. But with a dark color scheme, the line is also white.
Oh, right, I didn't consider textview themeability, I need to play with it a bit, but i think I can fix that.
I made that border a transparent black, so it should blend nicelly with different color combinations. See commits 85e37925f019f0232ad4b0813fc504fb7e2cf64f and 17d1cd1506f04f1d737bb562fb5811e0e07538e9 on master and gtk-3-20 branches.
Thanks. There is still a problem when the current line is highlighted. But it's maybe something that needs to be fixed in GtkSourceView.
Lemme take a look, maybe I can dodge that via the theme
Sorry to reopen, but the border line should be removed I think. It should be only a gray background color. At least for 3.20. Because the border line doesn't fit well with some other (optional) things displayed in the margin, like Git (display colors where lines are modified/added). And also GtkSourceView doesn't draw the border line for the current line, if current line highlighting is enabled. This is maybe fixable for 3.22 though. But we probably need to add an option in GtkSourceView to show/hide the border line. The border line looks nice when only the line numbers are shown.
(In reply to Sébastien Wilmet from comment #9) > Sorry to reopen, but the border line should be removed I think. It should be > only a gray background color. At least for 3.20. Because the border line > doesn't fit well with some other (optional) things displayed in the margin, > like Git (display colors where lines are modified/added). And also > GtkSourceView doesn't draw the border line for the current line, if current > line highlighting is enabled. We do this in Builder to remove it: """ /* Workaround Adwaita adding borders we don't want */ textview border.left { background: none; } """
Christian, that's why Adwaita should define only a simple background color, without the border line. I.e. the problem should be fixed at the right place, not with a workaround in applications. See the first comment of this bug for the rationale.
Agreed. I just wanted to point out that the two GNOME applications most likely to present a GtkSourceView widget don't want the border.
Note how you said Gtk*Source*View, not GtkTextView - and it has its own color scheme configuration machinery. One could argue that GtkSourceView should provide css that works for its users. But maybe taking out the border for all text views in Adwaita is fine too... I don't think other users of GtkTextView make much use of border windows.
That border could just go, it just looks a little more polished with it, but if that causes issues it doesn't worth keeping, I'll take a look asap.
Addressed in gtk-3-20 branch with commit 6e56aaffe3f2a4a30ae42bcbc3bc124c0ca369a9 and in master branch with d1d763ce58889dda7fa537927f7b15abecfdf06c
Thanks! I've tested on both gtk-3-20 and master and it works fine.