From: Corey Berla Date: Mon, 9 Jan 2023 06:32:22 +0000 (-0800) Subject: gtkmodelbutton: Ensure that accel label is always aligned to end X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~8^2~80^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e20bc7723ab0091c169f40e86deca44c5bd122d4;p=gtk4.git gtkmodelbutton: Ensure that accel label is always aligned to end When the model button just has a text label and accel text, the button fills and the accel label is implicitly aigned to end. When there's also a icon, even though it's not shown (because icons are only shown if there's no text), the button doesn't fill and the accel ends up not aligned (assuming one of the other buttons is longer). Ensure that the accel label is aligned to the end. Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5504 --- diff --git a/gtk/gtkmodelbutton.c b/gtk/gtkmodelbutton.c index d0795315d2..f1409c89ff 100644 --- a/gtk/gtkmodelbutton.c +++ b/gtk/gtkmodelbutton.c @@ -832,6 +832,8 @@ update_accel (GtkModelButton *self, "css-name", "accelerator", NULL); gtk_widget_insert_before (self->accel_label, GTK_WIDGET (self), NULL); + gtk_widget_set_hexpand (self->accel_label, TRUE), + gtk_widget_set_halign (self->accel_label, GTK_ALIGN_END); } gtk_accelerator_parse (accel, &key, &mods);