diff options
-rw-r--r-- | demos/gtk-demo/listbox.ui | 2 | ||||
-rw-r--r-- | demos/widget-factory/widget-factory.ui | 6 | ||||
-rw-r--r-- | docs/reference/gtk/gtk4-sections.txt | 4 | ||||
-rw-r--r-- | gtk/gtkmenubutton.c | 61 | ||||
-rw-r--r-- | gtk/gtkmenubutton.h | 6 | ||||
-rw-r--r-- | testsuite/gtk/focus-chain/widget-factory.ui | 6 | ||||
-rw-r--r-- | testsuite/gtk/focus-chain/widget-factory2.ui | 8 | ||||
-rw-r--r-- | testsuite/gtk/focus-chain/widget-factory3.ui | 6 |
8 files changed, 45 insertions, 54 deletions
diff --git a/demos/gtk-demo/listbox.ui b/demos/gtk-demo/listbox.ui index c43ec2321a..a5ebac17d6 100644 --- a/demos/gtk-demo/listbox.ui +++ b/demos/gtk-demo/listbox.ui @@ -161,7 +161,7 @@ <object class="GtkMenuButton" id="more-button"> <property name="receives-default">1</property> <property name="menu-model">menu1</property> - <property name="relief">none</property> + <property name="has-frame">0</property> <property name="label" translatable="yes">More...</property> </object> </child> diff --git a/demos/widget-factory/widget-factory.ui b/demos/widget-factory/widget-factory.ui index ff76f86d27..a8f6923343 100644 --- a/demos/widget-factory/widget-factory.ui +++ b/demos/widget-factory/widget-factory.ui @@ -2639,7 +2639,7 @@ microphone-sensitivity-medium-symbolic</property> <property name="valign">center</property> <property name="popover">notebook_info_popover2</property> <property name="icon-name">emblem-important-symbolic</property> - <property name="relief">none</property> + <property name="has-frame">0</property> <style> <class name="circular"/> </style> @@ -2783,7 +2783,7 @@ microphone-sensitivity-medium-symbolic</property> <property name="valign">center</property> <property name="popover">notebook_info_popover</property> <property name="icon-name">emblem-important-symbolic</property> - <property name="relief">none</property> + <property name="has-frame">0</property> <style> <class name="circular"/> </style> @@ -3275,7 +3275,7 @@ bad things might happen.</property> <property name="valign">center</property> <property name="popover">notebook_info_popover3</property> <property name="icon-name">emblem-important-symbolic</property> - <property name="relief">none</property> + <property name="has-frame">0</property> <style> <class name="circular"/> </style> diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt index 0b32fd1d4a..134d973406 100644 --- a/docs/reference/gtk/gtk4-sections.txt +++ b/docs/reference/gtk/gtk4-sections.txt @@ -1710,8 +1710,8 @@ gtk_menu_button_set_icon_name gtk_menu_button_get_icon_name gtk_menu_button_set_label gtk_menu_button_get_label -gtk_menu_button_set_relief -gtk_menu_button_get_relief +gtk_menu_button_set_has_frame +gtk_menu_button_get_has_frame gtk_menu_button_popup gtk_menu_button_popdown GtkMenuButtonCreatePopupFunc diff --git a/gtk/gtkmenubutton.c b/gtk/gtkmenubutton.c index 3e9f78ca4a..b5d13d8556 100644 --- a/gtk/gtkmenubutton.c +++ b/gtk/gtkmenubutton.c @@ -166,7 +166,7 @@ enum PROP_ICON_NAME, PROP_LABEL, PROP_USE_UNDERLINE, - PROP_RELIEF, + PROP_HAS_FRAME, LAST_PROP }; @@ -207,8 +207,8 @@ gtk_menu_button_set_property (GObject *object, case PROP_USE_UNDERLINE: gtk_menu_button_set_use_underline (self, g_value_get_boolean (value)); break; - case PROP_RELIEF: - gtk_menu_button_set_relief (self, g_value_get_enum (value)); + case PROP_HAS_FRAME: + gtk_menu_button_set_has_frame (self, g_value_get_boolean (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -246,8 +246,8 @@ gtk_menu_button_get_property (GObject *object, case PROP_USE_UNDERLINE: g_value_set_boolean (value, gtk_menu_button_get_use_underline (GTK_MENU_BUTTON (object))); break; - case PROP_RELIEF: - g_value_set_enum (value, gtk_menu_button_get_relief (GTK_MENU_BUTTON (object))); + case PROP_HAS_FRAME: + g_value_set_boolean (value, gtk_menu_button_get_has_frame (GTK_MENU_BUTTON (object))); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -431,13 +431,12 @@ gtk_menu_button_class_init (GtkMenuButtonClass *klass) FALSE, GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY); - menu_button_props[PROP_RELIEF] = - g_param_spec_enum ("relief", - P_("Border relief"), - P_("The border relief style"), - GTK_TYPE_RELIEF_STYLE, - GTK_RELIEF_NORMAL, - GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY); + menu_button_props[PROP_HAS_FRAME] = + g_param_spec_boolean ("has-frame", + P_("Has frame"), + P_("Whether the button has a frame"), + TRUE, + GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY); g_object_class_install_properties (gobject_class, LAST_PROP, menu_button_props); @@ -932,47 +931,39 @@ gtk_menu_button_get_label (GtkMenuButton *menu_button) } /** - * gtk_menu_button_set_relief: - * @menu_button: The #GtkMenuButton you want to set relief styles of - * @relief: The GtkReliefStyle as described above - * - * Sets the relief style of the edges of the given - * #GtkMenuButton widget. + * gtk_menu_button_set_has_frame: + * @menu_button: a #GtkMenuButton + * @has_frame: whether the button should have a visible frame * - * Two styles exist, %GTK_RELIEF_NORMAL and %GTK_RELIEF_NONE. - * The default style is, as one can guess, %GTK_RELIEF_NORMAL. + * Sets the style of the button. */ void -gtk_menu_button_set_relief (GtkMenuButton *menu_button, - GtkReliefStyle relief) +gtk_menu_button_set_has_frame (GtkMenuButton *menu_button, + gboolean has_frame) { - gboolean has_frame; - g_return_if_fail (GTK_IS_MENU_BUTTON (menu_button)); - has_frame = relief == GTK_RELIEF_NORMAL; if (gtk_button_get_has_frame (GTK_BUTTON (menu_button->button)) == has_frame) return; 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]); + g_object_notify_by_pspec (G_OBJECT (menu_button), menu_button_props[PROP_HAS_FRAME]); } /** - * gtk_menu_button_get_relief: - * @menu_button: The #GtkMenuButton you want the #GtkReliefStyle from. + * gtk_menu_button_get_has_frame: + * @menu_button: a #GtkMenuButton * - * Returns the current relief style of the given #GtkMenuButton. + * Returns whether the button has a frame. * - * Returns: The current #GtkReliefStyle + * Returns: %TRUE if the button has a frame */ -GtkReliefStyle -gtk_menu_button_get_relief (GtkMenuButton *menu_button) +gboolean +gtk_menu_button_get_has_frame (GtkMenuButton *menu_button) { - g_return_val_if_fail (GTK_IS_MENU_BUTTON (menu_button), GTK_RELIEF_NORMAL); + g_return_val_if_fail (GTK_IS_MENU_BUTTON (menu_button), TRUE); - return gtk_button_get_has_frame (GTK_BUTTON (menu_button->button)) - ? GTK_RELIEF_NORMAL : GTK_RELIEF_NONE; + return gtk_button_get_has_frame (GTK_BUTTON (menu_button->button)); } /** diff --git a/gtk/gtkmenubutton.h b/gtk/gtkmenubutton.h index 874a703520..e8f5e90f27 100644 --- a/gtk/gtkmenubutton.h +++ b/gtk/gtkmenubutton.h @@ -96,10 +96,10 @@ GDK_AVAILABLE_IN_ALL gboolean gtk_menu_button_get_use_underline (GtkMenuButton *menu_button); GDK_AVAILABLE_IN_ALL -void gtk_menu_button_set_relief (GtkMenuButton *menu_button, - GtkReliefStyle relief); +void gtk_menu_button_set_has_frame (GtkMenuButton *menu_button, + gboolean has_frame); GDK_AVAILABLE_IN_ALL -GtkReliefStyle gtk_menu_button_get_relief (GtkMenuButton *menu_button); +gboolean gtk_menu_button_get_has_frame (GtkMenuButton *menu_button); GDK_AVAILABLE_IN_ALL void gtk_menu_button_popup (GtkMenuButton *menu_button); diff --git a/testsuite/gtk/focus-chain/widget-factory.ui b/testsuite/gtk/focus-chain/widget-factory.ui index c25cf9e665..0d577c431d 100644 --- a/testsuite/gtk/focus-chain/widget-factory.ui +++ b/testsuite/gtk/focus-chain/widget-factory.ui @@ -2633,7 +2633,7 @@ microphone-sensitivity-medium-symbolic</property> <property name="valign">center</property> <property name="popover">notebook_info_popover2</property> <property name="icon-name">emblem-important-symbolic</property> - <property name="relief">none</property> + <property name="has-frame">0</property> <style> <class name="circular"/> </style> @@ -2774,7 +2774,7 @@ microphone-sensitivity-medium-symbolic</property> <property name="valign">center</property> <property name="popover">notebook_info_popover</property> <property name="icon-name">emblem-important-symbolic</property> - <property name="relief">none</property> + <property name="has-frame">0</property> <style> <class name="circular"/> </style> @@ -3266,7 +3266,7 @@ bad things might happen.</property> <property name="valign">center</property> <property name="popover">notebook_info_popover3</property> <property name="icon-name">emblem-important-symbolic</property> - <property name="relief">none</property> + <property name="has-frame">0</property> <style> <class name="circular"/> </style> diff --git a/testsuite/gtk/focus-chain/widget-factory2.ui b/testsuite/gtk/focus-chain/widget-factory2.ui index 1cd62fb7f2..41b05fa134 100644 --- a/testsuite/gtk/focus-chain/widget-factory2.ui +++ b/testsuite/gtk/focus-chain/widget-factory2.ui @@ -867,7 +867,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property> <property name="label" translatable="yes">link button</property> <property name="receives-default">1</property> <property name="has-tooltip">1</property> - <property name="relief">none</property> + <property name="has-frame">0</property> <property name="uri">http://www.gtk.org</property> </object> </child> @@ -2634,7 +2634,7 @@ microphone-sensitivity-medium-symbolic</property> <property name="valign">center</property> <property name="popover">notebook_info_popover2</property> <property name="icon-name">emblem-important-symbolic</property> - <property name="relief">none</property> + <property name="has-frame">0</property> <style> <class name="circular"/> </style> @@ -2775,7 +2775,7 @@ microphone-sensitivity-medium-symbolic</property> <property name="valign">center</property> <property name="popover">notebook_info_popover</property> <property name="icon-name">emblem-important-symbolic</property> - <property name="relief">none</property> + <property name="has-frame">0</property> <style> <class name="circular"/> </style> @@ -3267,7 +3267,7 @@ bad things might happen.</property> <property name="valign">center</property> <property name="popover">notebook_info_popover3</property> <property name="icon-name">emblem-important-symbolic</property> - <property name="relief">none</property> + <property name="has-frame">0</property> <style> <class name="circular"/> </style> diff --git a/testsuite/gtk/focus-chain/widget-factory3.ui b/testsuite/gtk/focus-chain/widget-factory3.ui index d5d557581e..2cc3c4e01a 100644 --- a/testsuite/gtk/focus-chain/widget-factory3.ui +++ b/testsuite/gtk/focus-chain/widget-factory3.ui @@ -2634,7 +2634,7 @@ microphone-sensitivity-medium-symbolic</property> <property name="valign">center</property> <property name="popover">notebook_info_popover2</property> <property name="icon-name">emblem-important-symbolic</property> - <property name="relief">none</property> + <property name="has-frame">0</property> <style> <class name="circular"/> </style> @@ -2775,7 +2775,7 @@ microphone-sensitivity-medium-symbolic</property> <property name="valign">center</property> <property name="popover">notebook_info_popover</property> <property name="icon-name">emblem-important-symbolic</property> - <property name="relief">none</property> + <property name="has-frame">0</property> <style> <class name="circular"/> </style> @@ -3267,7 +3267,7 @@ bad things might happen.</property> <property name="valign">center</property> <property name="popover">notebook_info_popover3</property> <property name="icon-name">emblem-important-symbolic</property> - <property name="relief">none</property> + <property name="has-frame">0</property> <style> <class name="circular"/> </style> |