Custom widget in ColumnView header?

In GTK3 there was the function TreeViewColumn.set_widget which could be used to set a custom widget as the header of a treeview column.

In GTK4 the non-deprecated replacement of TreeViewColumn is ColumnViewColumn which only provides the ability to set custom text as the header, not a custom widget.

In Inkscape a custom header widget is used in the XML editor for two things: to use an icon as the header instead of text, and to make the icon clickable:

image

How can these things be accomplished using GTK4’s ColumnView?

Moved to a new issue: