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 764203 - Default background color for the 'textview border' node
Default background color for the 'textview border' node
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Themes
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-03-25 17:29 UTC by Sébastien Wilmet
Modified: 2016-05-27 10:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gedit 3.18 with light gray background for line numbers (13.21 KB, image/png)
2016-03-25 17:30 UTC, Sébastien Wilmet
Details
gedit 3.20 (11.83 KB, image/png)
2016-03-25 17:30 UTC, Sébastien Wilmet
Details
gedit with dark color scheme with the patch (15.12 KB, image/png)
2016-04-02 15:46 UTC, Sébastien Wilmet
Details

Description Sébastien Wilmet 2016-03-25 17:29:01 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.
Comment 1 Sébastien Wilmet 2016-03-25 17:30:11 UTC
Created attachment 324763 [details]
gedit 3.18 with light gray background for line numbers
Comment 2 Sébastien Wilmet 2016-03-25 17:30:45 UTC
Created attachment 324764 [details]
gedit 3.20
Comment 3 Lapo Calamandrei 2016-04-02 14:28:33 UTC
Fixed in both master and 3.20 branch, commits d23c6c624628d31fa7c9dd543c96af18954018c2 and 30e234d84749dea9ed137bddc2e94c8ff7fa48b7 respectively
Comment 4 Sébastien Wilmet 2016-04-02 15:46:41 UTC
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.
Comment 5 Lapo Calamandrei 2016-04-02 22:27:06 UTC
Oh, right, I didn't consider textview themeability, I need to play with it a bit, but i think I can fix that.
Comment 6 Lapo Calamandrei 2016-04-04 10:17:14 UTC
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.
Comment 7 Sébastien Wilmet 2016-04-04 17:06:14 UTC
Thanks.

There is still a problem when the current line is highlighted. But it's maybe something that needs to be fixed in GtkSourceView.
Comment 8 Lapo Calamandrei 2016-04-06 11:42:42 UTC
Lemme take a look, maybe I can dodge that via the theme
Comment 9 Sébastien Wilmet 2016-05-25 09:34:26 UTC
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.
Comment 10 Christian Hergert 2016-05-25 12:10:13 UTC
(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;
}
"""
Comment 11 Sébastien Wilmet 2016-05-26 11:22:05 UTC
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.
Comment 12 Christian Hergert 2016-05-26 16:02:05 UTC
Agreed. I just wanted to point out that the two GNOME applications most likely to present a GtkSourceView widget don't want the border.
Comment 13 Matthias Clasen 2016-05-26 19:22:19 UTC
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.
Comment 14 Lapo Calamandrei 2016-05-26 21:17:25 UTC
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.
Comment 15 Lapo Calamandrei 2016-05-27 09:52:16 UTC
Addressed in gtk-3-20 branch with commit 6e56aaffe3f2a4a30ae42bcbc3bc124c0ca369a9 and in master branch with d1d763ce58889dda7fa537927f7b15abecfdf06c
Comment 16 Sébastien Wilmet 2016-05-27 10:57:21 UTC
Thanks! I've tested on both gtk-3-20 and master and it works fine.