|
|
@ -1760,29 +1760,38 @@ static struct cmd_results *cmd_layout(int argc, char **argv) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (strcasecmp(argv[0], "default") == 0) {
|
|
|
|
if (strcasecmp(argv[0], "default") == 0) {
|
|
|
|
swayc_t *output = swayc_parent_by_type(parent, C_OUTPUT);
|
|
|
|
parent->layout = parent->prev_layout;
|
|
|
|
parent->layout = default_layout(output);
|
|
|
|
if (parent->layout == L_NONE) {
|
|
|
|
} else if (strcasecmp(argv[0], "tabbed") == 0) {
|
|
|
|
swayc_t *output = swayc_parent_by_type(parent, C_OUTPUT);
|
|
|
|
if (parent->type != C_CONTAINER) {
|
|
|
|
parent->layout = default_layout(output);
|
|
|
|
parent = new_container(parent, L_TABBED);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
parent->layout = L_TABBED;
|
|
|
|
if (parent->layout != L_TABBED && parent->layout != L_STACKED) {
|
|
|
|
} else if (strcasecmp(argv[0], "stacking") == 0) {
|
|
|
|
parent->prev_layout = parent->layout;
|
|
|
|
if (parent->type != C_CONTAINER) {
|
|
|
|
|
|
|
|
parent = new_container(parent, L_STACKED);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
parent->layout = L_STACKED;
|
|
|
|
if (strcasecmp(argv[0], "tabbed") == 0) {
|
|
|
|
} else if (strcasecmp(argv[0], "splith") == 0) {
|
|
|
|
if (parent->type != C_CONTAINER) {
|
|
|
|
parent->layout = L_HORIZ;
|
|
|
|
parent = new_container(parent, L_TABBED);
|
|
|
|
} else if (strcasecmp(argv[0], "splitv") == 0) {
|
|
|
|
}
|
|
|
|
parent->layout = L_VERT;
|
|
|
|
|
|
|
|
} else if (strcasecmp(argv[0], "toggle") == 0 && argc == 2 && strcasecmp(argv[1], "split") == 0) {
|
|
|
|
parent->layout = L_TABBED;
|
|
|
|
if (parent->layout == L_VERT) {
|
|
|
|
} else if (strcasecmp(argv[0], "stacking") == 0) {
|
|
|
|
|
|
|
|
if (parent->type != C_CONTAINER) {
|
|
|
|
|
|
|
|
parent = new_container(parent, L_STACKED);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
parent->layout = L_STACKED;
|
|
|
|
|
|
|
|
} else if (strcasecmp(argv[0], "splith") == 0) {
|
|
|
|
parent->layout = L_HORIZ;
|
|
|
|
parent->layout = L_HORIZ;
|
|
|
|
} else {
|
|
|
|
} else if (strcasecmp(argv[0], "splitv") == 0) {
|
|
|
|
parent->layout = L_VERT;
|
|
|
|
parent->layout = L_VERT;
|
|
|
|
|
|
|
|
} else if (strcasecmp(argv[0], "toggle") == 0 && argc == 2 && strcasecmp(argv[1], "split") == 0) {
|
|
|
|
|
|
|
|
if (parent->layout == L_VERT) {
|
|
|
|
|
|
|
|
parent->layout = L_HORIZ;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
parent->layout = L_VERT;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|