summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar wil <william.barsse@gmail.com>2016-12-29 20:26:35 +0100
committerLibravatar wil <william.barsse@gmail.com>2016-12-29 20:31:30 +0100
commita0aa8d9780c6c8b0138800e3b2c2c0053174a2c5 (patch)
treec82dec85d4f5c9dbe0b93131f56614bccaa3a227 /include
parent[fix] move next/prev behavior for vert/horiz layout (diff)
downloadsway-a0aa8d9780c6c8b0138800e3b2c2c0053174a2c5.tar.gz
sway-a0aa8d9780c6c8b0138800e3b2c2c0053174a2c5.tar.zst
sway-a0aa8d9780c6c8b0138800e3b2c2c0053174a2c5.zip
cleanup in auto layouts
- added L_AUTO_FIRST/LAST instead of using explicit layouts. - when switching between auto layout that don't share the same major axis, invert the width/height of their child views to preserve their relative proportions.
Diffstat (limited to 'include')
-rw-r--r--include/sway/container.h3
-rw-r--r--include/sway/layout.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/include/sway/container.h b/include/sway/container.h
index 1d0fb265..f0574b1b 100644
--- a/include/sway/container.h
+++ b/include/sway/container.h
@@ -44,6 +44,9 @@ enum swayc_layouts {
44 L_AUTO_TOP, 44 L_AUTO_TOP,
45 L_AUTO_BOTTOM, 45 L_AUTO_BOTTOM,
46 46
47 L_AUTO_FIRST = L_AUTO_LEFT,
48 L_AUTO_LAST = L_AUTO_BOTTOM,
49
47 // Keep last 50 // Keep last
48 L_LAYOUTS, 51 L_LAYOUTS,
49}; 52};
diff --git a/include/sway/layout.h b/include/sway/layout.h
index 38096947..a771a72e 100644
--- a/include/sway/layout.h
+++ b/include/sway/layout.h
@@ -76,6 +76,6 @@ void swayc_log(log_importance_t verbosity, swayc_t *cont, const char* format, ..
76enum swayc_layouts default_layout(swayc_t *output); 76enum swayc_layouts default_layout(swayc_t *output);
77 77
78inline bool is_auto_layout(enum swayc_layouts layout) { 78inline bool is_auto_layout(enum swayc_layouts layout) {
79 return (layout >= L_AUTO_LEFT) && (layout <= L_AUTO_BOTTOM); 79 return (layout >= L_AUTO_FIRST) && (layout <= L_AUTO_LAST);
80} 80}
81#endif 81#endif