Only button with label has linked style

Only button with label has linked style.

var button_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
button_box.get_style_context ().add_class (Gtk.STYLE_CLASS_LINKED);

info_button = new Gtk.Button.from_icon_name ("dialog-information-symbolic", Gtk.IconSize.LARGE_TOOLBAR);
button_box.add (info_button);

button_with_label = new Gtk.Button.with_label (_("Test"));
button_box.add (button_with_label);

header_bar.pack_start (button_box);

1 Answer 1


The Gtk.HeaderBar provides special styling for Gtk.Button's so that they look good inside it.

The solution:

In your case the solution is easy: remove the image-button style class from the info_button: info_button.get_style_context ().remove_class ("image-button");

If you have any problems with Gtk styling further on, I recommend to enable Gtk Inspector (read more here: https://wiki.gnome.org/Projects/GTK+/Inspector) which will provide you with great tools to enable / disable Gtk properties and such.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.