AdwExpanderRow modify css nodes?

I’ve got an AdwExpanderRow and would like to try modifying/moving the arrow.

I’m guessing it could be a matter of fiddling with ‘css nodes’ and the docs does mention ‘image.expander-row-arrow’ but I’ve no idea how access those ‘nodes’. My experience of css spans as far as .add_css_class(‘card’).

I’ve of course done some searching but nothing pops up that looks into what I’m hoping to try out - just lots of guides on how to write css classes. It seems you can write a css class and use it via GtkCssProvider. Would I have to write a whole new css class and apply that to my AdwExpanderRow or can I modify the existing one as I add the row to the listbox?

Thank you for any help

You can create a style.css file and add it to your app’s resources (See Adw.Application#automatic-resources and Gio.Resource for more info). Then in style.css you can access the arrow of all expander rows with

row.expander .expander-row-arrow {
  /* properties for expander row arrow */
}

If you would like to access only a specific set of expander rows, you can add a custom CSS class to those specific rows.

In code:

gtk_widget_add_css_class (GTK_WIDGET (row), "mycustomrow");

In CSS:

.mycustomrow .expander-row-arrow {
  /* properties */
}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.