[libwnck/wip/muktupavels/gtk4: 10/13] wnck-image-menu-item: use measure vfunc
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libwnck/wip/muktupavels/gtk4: 10/13] wnck-image-menu-item: use measure vfunc
- Date: Sun, 21 May 2017 00:13:08 +0000 (UTC)
commit 7cad77c13737473eb1d83f3b2cebe3bd1dff87ce
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sun May 21 02:29:05 2017 +0300
wnck-image-menu-item: use measure vfunc
libwnck/wnck-image-menu-item.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/libwnck/wnck-image-menu-item.c b/libwnck/wnck-image-menu-item.c
index b1d4c26..93e42d9 100644
--- a/libwnck/wnck-image-menu-item.c
+++ b/libwnck/wnck-image-menu-item.c
@@ -36,9 +36,13 @@ struct _WnckImageMenuItem
G_DEFINE_TYPE (WnckImageMenuItem, wnck_image_menu_item, GTK_TYPE_MENU_ITEM)
static void
-wnck_image_menu_item_get_preferred_width (GtkWidget *widget,
- gint *minimum,
- gint *natural)
+wnck_image_menu_item_measure (GtkWidget *widget,
+ GtkOrientation orientation,
+ int for_size,
+ int *minimum,
+ int *natural,
+ int *minimum_baseline,
+ int *natural_baseline)
{
GtkWidgetClass *widget_class;
WnckImageMenuItem *item;
@@ -47,9 +51,11 @@ wnck_image_menu_item_get_preferred_width (GtkWidget *widget,
widget_class = GTK_WIDGET_CLASS (wnck_image_menu_item_parent_class);
item = WNCK_IMAGE_MENU_ITEM (widget);
- widget_class->get_preferred_width (widget, minimum, natural);
+ widget_class->measure (widget, orientation, for_size,minimum, natural,
+ minimum_baseline, natural_baseline);
- if (!gtk_widget_get_visible (item->image))
+ if (!gtk_widget_get_visible (item->image) ||
+ orientation != GTK_ORIENTATION_HORIZONTAL)
return;
gtk_widget_get_preferred_size (item->image, &image_requisition, NULL);
@@ -152,7 +158,7 @@ wnck_image_menu_item_class_init (WnckImageMenuItemClass *item_class)
widget_class = GTK_WIDGET_CLASS (item_class);
menu_item_class = GTK_MENU_ITEM_CLASS (item_class);
- widget_class->get_preferred_width = wnck_image_menu_item_get_preferred_width;
+ widget_class->measure = wnck_image_menu_item_measure;
widget_class->size_allocate = wnck_image_menu_item_size_allocate;
menu_item_class->get_label = wnck_image_menu_item_get_label;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]