diff options
author | wil <william.barsse@gmail.com> | 2016-12-29 20:26:35 +0100 |
---|---|---|
committer | wil <william.barsse@gmail.com> | 2016-12-29 20:31:30 +0100 |
commit | a0aa8d9780c6c8b0138800e3b2c2c0053174a2c5 (patch) | |
tree | c82dec85d4f5c9dbe0b93131f56614bccaa3a227 /sway/commands/workspace_layout.c | |
parent | [fix] move next/prev behavior for vert/horiz layout (diff) | |
download | sway-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 'sway/commands/workspace_layout.c')
-rw-r--r-- | sway/commands/workspace_layout.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sway/commands/workspace_layout.c b/sway/commands/workspace_layout.c index b7b4b033..3e0a12ce 100644 --- a/sway/commands/workspace_layout.c +++ b/sway/commands/workspace_layout.c | |||
@@ -13,8 +13,16 @@ struct cmd_results *cmd_workspace_layout(int argc, char **argv) { | |||
13 | config->default_layout = L_STACKED; | 13 | config->default_layout = L_STACKED; |
14 | } else if (strcasecmp(argv[0], "tabbed") == 0) { | 14 | } else if (strcasecmp(argv[0], "tabbed") == 0) { |
15 | config->default_layout = L_TABBED; | 15 | config->default_layout = L_TABBED; |
16 | } else if (strcasecmp(argv[0], "auto_left") == 0) { | ||
17 | config->default_layout = L_AUTO_LEFT; | ||
18 | } else if (strcasecmp(argv[0], "auto_right") == 0) { | ||
19 | config->default_layout = L_AUTO_RIGHT; | ||
20 | } else if (strcasecmp(argv[0], "auto_top") == 0) { | ||
21 | config->default_layout = L_AUTO_TOP; | ||
22 | } else if (strcasecmp(argv[0], "auto_bottom") == 0) { | ||
23 | config->default_layout = L_AUTO_BOTTOM; | ||
16 | } else { | 24 | } else { |
17 | return cmd_results_new(CMD_INVALID, "workspace_layout", "Expected 'workspace_layout <default|stacking|tabbed>'"); | 25 | return cmd_results_new(CMD_INVALID, "workspace_layout", "Expected 'workspace_layout <default|stacking|tabbed|auto_left|auto_right|auto_top|auto_bottom>'"); |
18 | } | 26 | } |
19 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 27 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
20 | } | 28 | } |