mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-14 14:20:21 +00:00
menubutton: Reset label when setting icon name and vice versa
Match GtkButton.
This commit is contained in:
parent
f3befe530b
commit
76df60db2b
@ -843,8 +843,16 @@ gtk_menu_button_set_icon_name (GtkMenuButton *menu_button,
|
||||
{
|
||||
g_return_if_fail (GTK_IS_MENU_BUTTON (menu_button));
|
||||
|
||||
g_object_freeze_notify (G_OBJECT (menu_button));
|
||||
|
||||
if (gtk_menu_button_get_label (menu_button))
|
||||
g_object_notify_by_pspec (G_OBJECT (menu_button), menu_button_props[PROP_LABEL]);
|
||||
|
||||
gtk_button_set_icon_name (GTK_BUTTON (menu_button->button), icon_name);
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (menu_button), menu_button_props[PROP_ICON_NAME]);
|
||||
|
||||
g_object_thaw_notify (G_OBJECT (menu_button));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -880,6 +888,11 @@ gtk_menu_button_set_label (GtkMenuButton *menu_button,
|
||||
|
||||
g_return_if_fail (GTK_IS_MENU_BUTTON (menu_button));
|
||||
|
||||
g_object_freeze_notify (G_OBJECT (menu_button));
|
||||
|
||||
if (gtk_menu_button_get_icon_name (menu_button))
|
||||
g_object_notify_by_pspec (G_OBJECT (menu_button), menu_button_props[PROP_ICON_NAME]);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
|
||||
label_widget = gtk_label_new (label);
|
||||
g_return_if_fail (GTK_IS_MENU_BUTTON (menu_button));
|
||||
@ -897,6 +910,8 @@ gtk_menu_button_set_label (GtkMenuButton *menu_button,
|
||||
menu_button->label_widget = label_widget;
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (menu_button), menu_button_props[PROP_LABEL]);
|
||||
|
||||
g_object_thaw_notify (G_OBJECT (menu_button));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user