[gtk/gtk-3-22] separatormenuitem: Don't create label widget in get_label
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-3-22] separatormenuitem: Don't create label widget in get_label
- Date: Thu, 1 Mar 2018 18:53:36 +0000 (UTC)
commit b13362b369a8a74aab04447699d49d698e321101
Author: Timm Bäder <mail baedert org>
Date: Mon Feb 5 10:38:37 2018 +0100
separatormenuitem: Don't create label widget in get_label
Calling gtk_menu_item_get_label on a GtkSeparatorMenuItem would
otherwise create a GtkLabel child, increasing the vertical size request
to that of the child label.
gtk/gtkseparatormenuitem.c | 9 +++++++++
1 file changed, 9 insertions(+)
---
diff --git a/gtk/gtkseparatormenuitem.c b/gtk/gtkseparatormenuitem.c
index 80941a1aa2..1073deb7d9 100644
--- a/gtk/gtkseparatormenuitem.c
+++ b/gtk/gtkseparatormenuitem.c
@@ -44,11 +44,20 @@
G_DEFINE_TYPE (GtkSeparatorMenuItem, gtk_separator_menu_item, GTK_TYPE_MENU_ITEM)
+
+static const char *
+gtk_separator_menu_item_get_label (GtkMenuItem *item)
+{
+ return "";
+}
+
static void
gtk_separator_menu_item_class_init (GtkSeparatorMenuItemClass *class)
{
GTK_CONTAINER_CLASS (class)->child_type = NULL;
+ GTK_MENU_ITEM_CLASS (class)->get_label = gtk_separator_menu_item_get_label;
+
gtk_widget_class_set_accessible_role (GTK_WIDGET_CLASS (class), ATK_ROLE_SEPARATOR);
gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (class), "separator");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]