summaryrefslogtreecommitdiff
path: root/olddocs/layoutplan.md
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-05-16 19:57:25 -0400
committerPietro Gagliardi <[email protected]>2014-05-16 19:57:25 -0400
commit332f9ffd5b77c73bb077933b4b5f592c9d9cde6c (patch)
tree8c344eecd660c35da0990a6826d0d425f98e6646 /olddocs/layoutplan.md
parentdc179b3a44581d0e2da5748c69792de7b98d96a6 (diff)
Moved some old documents out of the top-level directory and into a folder olddocs/ to make things neater.
Diffstat (limited to 'olddocs/layoutplan.md')
-rw-r--r--olddocs/layoutplan.md25
1 files changed, 25 insertions, 0 deletions
diff --git a/olddocs/layoutplan.md b/olddocs/layoutplan.md
new file mode 100644
index 0000000..9ababf6
--- /dev/null
+++ b/olddocs/layoutplan.md
@@ -0,0 +1,25 @@
+A Stack is a stack of controls arranged horizontally or vertically.
+ If horizontal, all controls take the same heights, and use their preferred widths.
+ If vertical, all controls take the same widths, and use their preferred heights.
+
+PROBLEM
+ We want to have controls that stretch with the window
+SOLUTION
+ Delegate one control as the "stretchy" control.
+ s := NewVerticalStack(c1, c2, c3)
+ s.SetStretchy(1) // c2
+ When drawing, all other controls have their positions and sizes determiend, then the stretchy one's is.
+
+PROBLEM
+ We want to have a control that's anchored (resizes with) the top left and one that's anchored with the top right.
+SOLUTION
+ Allow stretchiness for arbitrary controls
+ s.SetStretchy(1)
+ s.SetStretchy(2)
+ When drawing, the sizes of non-stretchy controls are determined first, then all stretchy controls are given equal amounts of the rest.
+ The preferred size of the stack is the preferred size of non-stretchy controls + (the number of stretchy controls * the largest preferred size of the stretchy controls).
+
+PROBLEM
+ Non-equal size distribution of stretchy controls: for instance, in a horizontal stack, a navigation bar is usually a fixed size and the content area fills the rest.
+SOLUTION
+ I'm not entirely sure how to fix this one yet; I do know for a navigation pane the user is usually in control of the size, so... will figure out later.