button: Center images

If we leave the valign to be the default fill, then
the images pick up baseline alignment from the environment,
which can occasionally lead to misplaced -/+ icons in
spinbuttons, for example in the "Page Setup" tab of
the print dialog.
This commit is contained in:
Matthias Clasen
2020-06-15 12:23:32 -04:00
parent 23e3d48eb9
commit b526722000

View File

@@ -973,6 +973,7 @@ gtk_button_set_icon_name (GtkButton *button,
{
GtkWidget *child = gtk_image_new_from_icon_name (icon_name);
gtk_button_set_child (GTK_BUTTON (button), child);
gtk_widget_set_valign (child, GTK_ALIGN_CENTER);
gtk_widget_remove_css_class (GTK_WIDGET (button), "text-button");
gtk_widget_add_css_class (GTK_WIDGET (button), "image-button");
}