Transparent TextView gutter (original) (raw)
February 4, 2025, 10:51pm 1
I’m using Adwaita theme with GtkTextView
, where want to apply background onto the child Widget
only (Label
in my case), but the gutter
has it own color, that hides by itself some part of content in TextView
.
Found some tips here but can I turn it off without CSS, like properties?
gwillems February 5, 2025, 3:12pm 2
Hi,
No, not with properties.
To change the gutter appearance, you can dynamically load small CSS snippets, something like:
textview > border {
background: none;
}
The CSS styling system is quite flexible and powerful, I don’t really get why you try to avoid it.
d47081 (D47081) February 5, 2025, 5:39pm 3
Thanks, but it does not work, like some parent container uses own background yet
tried also (in debugger)
textview > border {
background-color: rgba(0,0,0,0);
}
gwillems February 5, 2025, 8:52pm 4
Hmm… is it a standard GtkTextView, or a GtkSourceView?
(if you use the libspelling for spellchecking, it’s probably the latter one)
The GtkSourceView applies some extra theming on top of the CSS, that must first be disabled by calling GtkSource.Buffer.set_style_scheme with scheme=NULL.
If GtkTextView only, try removing the parents background too:
textview,
textview > text,
textview > border {
background: transparent;
}
d47081 (D47081)
February 5, 2025, 9:46pm 5
No, it’s default TextView
here I have colorized it with #ccc
- the CSS rule applying but some another “container” hides the content text at the right…
and I don’t see any other widget (frame) in the debugger, the label is target child there
But thanks for a tip, maybe that’s because ClampScrollable
delegates some styles there.
Maybe it’s also GTK renderer specifics, when I expect something similar in CSS behavior to HTML I have also tried to change
halign
properties, but no success. Did you tested your solution? Maybe it’s local issue (Fedora 41)
gwillems February 7, 2025, 2:52pm 6
I usually use GtkSourceView when using gutters.
I’ll try with GtkTextView.
system (system) Closed March 9, 2025, 2:53pm 7
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.