mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-14 20:51:07 +00:00
modelbutton: Don't show accels without text
We don't want to show accelerators in iconic buttons.
This commit is contained in:
parent
4a20a3fdb2
commit
17cb92889a
@ -572,6 +572,9 @@ update_visibility (GtkModelButton *self)
|
||||
gtk_widget_set_hexpand (self->label,
|
||||
gtk_widget_get_visible (self->label) && !has_icon);
|
||||
|
||||
if (self->accel_label)
|
||||
gtk_widget_set_visible (self->accel_label, has_text && (!self->iconic || !has_icon));
|
||||
|
||||
if (self->image)
|
||||
{
|
||||
gtk_widget_set_visible (self->image, has_icon && (self->iconic || !has_text));
|
||||
@ -792,6 +795,7 @@ gtk_model_button_set_accel (GtkModelButton *button,
|
||||
g_free (button->accel);
|
||||
button->accel = g_strdup (accel);
|
||||
update_accel (button, button->accel);
|
||||
update_visibility (button);
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (button), properties[PROP_ACCEL]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user