[gtk/wip/otte/listview: 204/207] widget: Add a hook for resizes
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/listview: 204/207] widget: Add a hook for resizes
- Date: Tue, 5 Nov 2019 21:13:48 +0000 (UTC)
commit a61230482c4c8fa8f9844047d7d44ed0d55f286c
Author: Benjamin Otte <otte redhat com>
Date: Tue Nov 5 00:40:17 2019 +0100
widget: Add a hook for resizes
It's private, no APIs, we don't talk about it. But we will start using
it very soon, so we can do size request caching in columns and avoid
sizegroups...
gtk/gtkwidget.c | 3 +++
gtk/gtkwidgetprivate.h | 1 +
2 files changed, 4 insertions(+)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index a3b88f8738..6ff6fa0cb5 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -4113,6 +4113,9 @@ gtk_widget_queue_resize_internal (GtkWidget *widget)
priv->resize_needed = TRUE;
gtk_widget_set_alloc_needed (widget);
+ if (priv->resize_func)
+ priv->resize_func (widget);
+
groups = _gtk_widget_get_sizegroups (widget);
for (l = groups; l; l = l->next)
diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h
index 68595f7aa9..ff602ee5e9 100644
--- a/gtk/gtkwidgetprivate.h
+++ b/gtk/gtkwidgetprivate.h
@@ -122,6 +122,7 @@ struct _GtkWidgetPrivate
int width_request;
int height_request;
+ void (* resize_func) (GtkWidget *);
GtkBorder margin;
/* Animations and other things to update on clock ticks */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]