[gtk+/wip/baedert/drawing: 115/241] checkmenuitem: Stop using the parent's gadget
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/drawing: 115/241] checkmenuitem: Stop using the parent's gadget
- Date: Thu, 15 Jun 2017 10:57:17 +0000 (UTC)
commit 5461fc5bc505ac841bdeb5975a0466255ac14b61
Author: Timm Bäder <mail baedert org>
Date: Sat May 6 14:15:15 2017 +0200
checkmenuitem: Stop using the parent's gadget
gtk/gtkcheckmenuitem.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkcheckmenuitem.c b/gtk/gtkcheckmenuitem.c
index 8c2f5c1..f40f891 100644
--- a/gtk/gtkcheckmenuitem.c
+++ b/gtk/gtkcheckmenuitem.c
@@ -116,17 +116,15 @@ gtk_check_menu_item_size_allocate (GtkWidget *widget,
{
GtkAllocation clip, widget_clip;
GtkAllocation content_alloc, indicator_alloc;
- GtkCssGadget *menu_item_gadget;
GtkCheckMenuItem *check_menu_item = GTK_CHECK_MENU_ITEM (widget);
GtkCheckMenuItemPrivate *priv = check_menu_item->priv;
- gint content_baseline, toggle_size;
+ gint toggle_size;
GTK_WIDGET_CLASS (gtk_check_menu_item_parent_class)->size_allocate
(widget, allocation);
- menu_item_gadget = _gtk_menu_item_get_gadget (GTK_MENU_ITEM (widget));
- gtk_css_gadget_get_content_allocation (menu_item_gadget,
- &content_alloc, &content_baseline);
+ gtk_widget_get_content_allocation (widget, &content_alloc);
+
gtk_css_gadget_get_preferred_size (priv->indicator_gadget,
GTK_ORIENTATION_HORIZONTAL,
@@ -152,7 +150,7 @@ gtk_check_menu_item_size_allocate (GtkWidget *widget,
gtk_css_gadget_allocate (check_menu_item->priv->indicator_gadget,
&indicator_alloc,
- content_baseline,
+ gtk_widget_get_allocated_baseline (widget),
&clip);
gtk_widget_get_clip (widget, &widget_clip);
@@ -496,8 +494,10 @@ gtk_check_menu_item_init (GtkCheckMenuItem *check_menu_item)
priv->indicator_gadget =
gtk_builtin_icon_new ("check",
GTK_WIDGET (check_menu_item),
- _gtk_menu_item_get_gadget (GTK_MENU_ITEM (check_menu_item)),
+ NULL,
NULL);
+ gtk_css_node_set_parent (gtk_css_gadget_get_node (priv->indicator_gadget),
+ gtk_widget_get_css_node (GTK_WIDGET (check_menu_item)));
update_node_state (check_menu_item);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]