[libhandy] clamp: Give sane defaults to the size properties



commit 1e553d6220c8894becf1a5f4259eace5f92ee985
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Fri Jun 12 10:14:33 2020 +0200

    clamp: Give sane defaults to the size properties
    
    Giving non-0 defaults to maximum-size and tightening-threshold should
    make the life of application developers easier while helping keeping the
    ecosystem consistent.

 src/hdy-clamp.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/hdy-clamp.c b/src/hdy-clamp.c
index 24f0a8b6..ab45efa5 100644
--- a/src/hdy-clamp.c
+++ b/src/hdy-clamp.c
@@ -416,7 +416,7 @@ hdy_clamp_class_init (HdyClampClass *klass)
       g_param_spec_int ("maximum-size",
                         _("Maximum size"),
                         _("The maximum size allocated to the child"),
-                        0, G_MAXINT, 0,
+                        0, G_MAXINT, 600,
                         G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
@@ -441,7 +441,7 @@ hdy_clamp_class_init (HdyClampClass *klass)
       g_param_spec_int ("tightening-threshold",
                         _("Tightening threshold"),
                         _("The size from which the clamp will tighten its grip on the child"),
-                        0, G_MAXINT, 0,
+                        0, G_MAXINT, 400,
                         G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (object_class, LAST_PROP, props);
@@ -452,6 +452,8 @@ hdy_clamp_class_init (HdyClampClass *klass)
 static void
 hdy_clamp_init (HdyClamp *self)
 {
+  self->maximum_size = 600;
+  self->tightening_threshold = 400;
 }
 
 /**


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