Transparent TextView gutter

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?

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.

1 Like

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);
}

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;
}
1 Like

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 :slight_smile: I have also tried to change halign properties, but no success. Did you tested your solution? Maybe it’s local issue (Fedora 41)

I usually use GtkSourceView when using gutters.

I’ll try with GtkTextView.