[libwnck/wip/muktupavels/gtk4: 106/109] 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: 106/109] wnck-image-menu-item: use measure vfunc
- Date: Thu, 13 May 2021 19:30:54 +0000 (UTC)
commit b239ee2613a45bafd60e9c49d31006e0dc309aa3
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 file changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/libwnck/wnck-image-menu-item.c b/libwnck/wnck-image-menu-item.c
index e8e6d87..bcba6a0 100644
--- a/libwnck/wnck-image-menu-item.c
+++ b/libwnck/wnck-image-menu-item.c
@@ -48,9 +48,13 @@ wnck_image_menu_item_finalize (GObject *object)
}
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;
@@ -59,9 +63,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);
@@ -168,7 +174,7 @@ wnck_image_menu_item_class_init (WnckImageMenuItemClass *item_class)
object_class->finalize = wnck_image_menu_item_finalize;
- 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]