diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-04-17 00:20:09 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-04-17 10:57:36 -0400 |
commit | df1816a29cb5e7b37494aaf7f92fcd6bba98e7ef (patch) | |
tree | 964c89f35e269b545b0b5d531cc66659a591f6f6 /gtk/gtkmenubutton.c | |
parent | fdbbef863dd34211311016eaaf58ae4767e9f409 (diff) | |
download | gtk+-df1816a29cb5e7b37494aaf7f92fcd6bba98e7ef.tar.gz |
button: Drop relief
We are only using this as a boolean, so change it
to a boolean property named has-frame.
Diffstat (limited to 'gtk/gtkmenubutton.c')
-rw-r--r-- | gtk/gtkmenubutton.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gtk/gtkmenubutton.c b/gtk/gtkmenubutton.c index c210d096d0..3e9f78ca4a 100644 --- a/gtk/gtkmenubutton.c +++ b/gtk/gtkmenubutton.c @@ -946,12 +946,15 @@ void gtk_menu_button_set_relief (GtkMenuButton *menu_button, GtkReliefStyle relief) { + gboolean has_frame; + g_return_if_fail (GTK_IS_MENU_BUTTON (menu_button)); - if (relief == gtk_button_get_relief (GTK_BUTTON (menu_button->button))) + has_frame = relief == GTK_RELIEF_NORMAL; + if (gtk_button_get_has_frame (GTK_BUTTON (menu_button->button)) == has_frame) return; - gtk_button_set_relief (GTK_BUTTON (menu_button->button), relief); + gtk_button_set_has_frame (GTK_BUTTON (menu_button->button), has_frame); g_object_notify_by_pspec (G_OBJECT (menu_button), menu_button_props[PROP_RELIEF]); } @@ -968,7 +971,8 @@ gtk_menu_button_get_relief (GtkMenuButton *menu_button) { g_return_val_if_fail (GTK_IS_MENU_BUTTON (menu_button), GTK_RELIEF_NORMAL); - return gtk_button_get_relief (GTK_BUTTON (menu_button->button)); + return gtk_button_get_has_frame (GTK_BUTTON (menu_button->button)) + ? GTK_RELIEF_NORMAL : GTK_RELIEF_NONE; } /** |