forked from AuroraMiddleware/gtk
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.
This commit is contained in:
parent
b68256f7a1
commit
b13362b369
@ -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");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user