[libhandy] column: Notify when changing size properties



commit 5d2d4fc142002d46eb3e52ff28f391bb93103242
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Mon Jun 8 17:24:46 2020 +0200

    column: Notify when changing size properties
    
    This also add guards to avoid invalidating the widget's size when the
    size properties didn't change.

 src/hdy-column.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/src/hdy-column.c b/src/hdy-column.c
index 33785b50..62d08b4d 100644
--- a/src/hdy-column.c
+++ b/src/hdy-column.c
@@ -372,9 +372,14 @@ hdy_column_set_maximum_width (HdyColumn *self,
 {
   g_return_if_fail (HDY_IS_COLUMN (self));
 
+  if (self->maximum_width == maximum_width)
+    return;
+
   self->maximum_width = maximum_width;
 
   gtk_widget_queue_resize (GTK_WIDGET (self));
+
+  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_MAXIMUM_WIDTH]);
 }
 
 /**
@@ -412,7 +417,12 @@ hdy_column_set_linear_growth_width (HdyColumn *self,
 {
   g_return_if_fail (HDY_IS_COLUMN (self));
 
+  if (self->linear_growth_width == linear_growth_width)
+    return;
+
   self->linear_growth_width = linear_growth_width;
 
   gtk_widget_queue_resize (GTK_WIDGET (self));
+
+  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_LINEAR_GROWTH_WIDTH]);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]