summaryrefslogtreecommitdiff
path: root/gtk/gtkmenuitem.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2016-10-22 16:06:14 +0200
committerTimm Bäder <mail@baedert.org>2016-10-22 19:05:47 +0200
commit9992a616efa47205ac16ed8be255eda5e7aadf6c (patch)
tree3879538642de33a77472bafe3e6e8afea3b3e343 /gtk/gtkmenuitem.c
parent6525b95e2502080c08b65317c910204c2b6125da (diff)
downloadgtk+-9992a616efa47205ac16ed8be255eda5e7aadf6c.tar.gz
widget: Use ::measure vfunc to measure size
Add a new ::measure vfunc similar to GtkCssGadget's that widget implementations have to override instead of the old get_preferred_width, get_preferred_height, get_preferred_width_for_height, get_preferred_height_for_width and get_preferred_height_and_baseline_for_width.
Diffstat (limited to 'gtk/gtkmenuitem.c')
-rw-r--r--gtk/gtkmenuitem.c45
1 files changed, 12 insertions, 33 deletions
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index b989d32d5d..9330a441e1 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -560,41 +560,22 @@ gtk_menu_item_measure (GtkCssGadget *gadget,
}
static void
-gtk_menu_item_get_preferred_width (GtkWidget *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_menu_item_measure_ (GtkWidget *widget,
+ GtkOrientation orientation,
+ int for_size,
+ int *minimum,
+ int *natural,
+ int *minimum_baseline,
+ int *natural_baseline)
{
gtk_css_gadget_get_preferred_size (GTK_MENU_ITEM (widget)->priv->gadget,
- GTK_ORIENTATION_HORIZONTAL,
- -1,
- minimum_size, natural_size,
- NULL, NULL);
+ orientation,
+ for_size,
+ minimum, natural,
+ minimum_baseline, natural_baseline);
}
-static void
-gtk_menu_item_get_preferred_height (GtkWidget *widget,
- gint *minimum_size,
- gint *natural_size)
-{
- gtk_css_gadget_get_preferred_size (GTK_MENU_ITEM (widget)->priv->gadget,
- GTK_ORIENTATION_VERTICAL,
- -1,
- minimum_size, natural_size,
- NULL, NULL);
-}
-static void
-gtk_menu_item_get_preferred_height_for_width (GtkWidget *widget,
- gint for_size,
- gint *minimum_size,
- gint *natural_size)
-{
- gtk_css_gadget_get_preferred_size (GTK_MENU_ITEM (widget)->priv->gadget,
- GTK_ORIENTATION_VERTICAL,
- for_size,
- minimum_size, natural_size,
- NULL, NULL);
-}
static void
gtk_menu_item_class_init (GtkMenuItemClass *klass)
@@ -620,9 +601,7 @@ gtk_menu_item_class_init (GtkMenuItemClass *klass)
widget_class->mnemonic_activate = gtk_menu_item_mnemonic_activate;
widget_class->parent_set = gtk_menu_item_parent_set;
widget_class->can_activate_accel = gtk_menu_item_can_activate_accel;
- widget_class->get_preferred_width = gtk_menu_item_get_preferred_width;
- widget_class->get_preferred_height = gtk_menu_item_get_preferred_height;
- widget_class->get_preferred_height_for_width = gtk_menu_item_get_preferred_height_for_width;
+ widget_class->measure = gtk_menu_item_measure_;
widget_class->direction_changed = gtk_menu_item_direction_changed;
container_class->forall = gtk_menu_item_forall;