[gtk/wip/ebassi/constraint-layout: 59/69] constraints demo: Update comments



commit 71b52f485e26a8eec0e583dd1b9a2d202030d817
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jun 29 10:15:42 2019 -0400

    constraints demo: Update comments

 demos/gtk-demo/constraints.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)
---
diff --git a/demos/gtk-demo/constraints.c b/demos/gtk-demo/constraints.c
index 806fd407ab..9e2bf3577d 100644
--- a/demos/gtk-demo/constraints.c
+++ b/demos/gtk-demo/constraints.c
@@ -44,20 +44,21 @@ simple_grid_class_init (SimpleGridClass *klass)
 
 /* Layout:
  *
- *   +-----------------------------+
- *   | +-----------+ +-----------+ |
- *   | |  Child 1  | |  Child 2  | |
- *   | +-----------+ +-----------+ |
- *   | +-------------------------+ |
- *   | |         Child 3         | |
- *   | +-------------------------+ |
- *   +-----------------------------+
+ *   +-------------------------------------+
+ *   | +-----------++-------++-----------+ |
+ *   | |  Child 1  || Space ||  Child 2  | |
+ *   | +-----------++-------++-----------+ |
+ *   | +---------------------------------+ |
+ *   | |             Child 3             | |
+ *   | +---------------------------------+ |
+ *   +-------------------------------------+
  *
  * Constraints:
  *
  *   super.start = child1.start - 8
  *   child1.width = child2.width
- *   child1.end = child2.start - 12
+ *   child1.end = space.start
+ *   space.end = child2.start
  *   child2.end = super.end - 8
  *   super.start = child3.start - 8
  *   child3.end = super.end - 8
@@ -69,6 +70,12 @@ simple_grid_class_init (SimpleGridClass *klass)
  *   child3.height = child2.height
  *   child3.bottom = super.bottom - 8
  *
+ * To add some flexibility, we make the space
+ * stretchable:
+ *
+ *   space.width >= 10
+ *   space.width = 100
+ *   space.width <= 200
  */
 static void
 build_constraints (SimpleGrid          *self,


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