Reputation: 6166
How can I make GtkBtton round in shape?
Upvotes: 4
Views: 3579
Reputation: 6797
The accepted answer said:
There is no roundness option in the base set.
Well, there is now! See the GTKWidget
documentation:
In special cases, buttons can be made round by adding the .circular style class.
So, for example:
gtk_style_context_add_class (gtk_widget_get_style_context (button),
"circular");
This works using both of the standard themes, Adwaita and HighContrast.
In GTK4, there are convenience functions to avoid having to get the StyleContext
yourself:
gtk_widget_add_css_class (button, "circular");
The above assumebutton
is a GtkWidget*
. If, instead, it's a GtkButton*
or subclass, just substitute in GTK_WIDGET (button)
of course.
Upvotes: 5
Reputation: 121
There are a few options.
Upvotes: 0