mirror of
https://github.com/swaywm/sway.git
synced 2026-05-04 06:46:25 -04:00
add tabbed windows
This commit is contained in:
parent
a8d1b05bac
commit
c7b3f9854f
5 changed files with 89 additions and 11 deletions
|
|
@ -159,6 +159,20 @@ static void apply_vert_layout(struct sway_container *parent) {
|
|||
child->height = parent->y + parent->height - child->y;
|
||||
}
|
||||
|
||||
static void apply_tabbed_layout(struct sway_container *parent) {
|
||||
size_t num_children = parent->children->length;
|
||||
if (!num_children) {
|
||||
return;
|
||||
}
|
||||
for (size_t i=0; i < num_children; ++i) {
|
||||
struct sway_container *child = parent->children->items[i];
|
||||
child->x = parent->x;
|
||||
child->y = parent->y;
|
||||
child->width = parent->width;
|
||||
child->height = parent->height;
|
||||
}
|
||||
}
|
||||
|
||||
void arrange_children_of(struct sway_container *parent) {
|
||||
if (config->reloading) {
|
||||
return;
|
||||
|
|
@ -189,6 +203,9 @@ void arrange_children_of(struct sway_container *parent) {
|
|||
case L_VERT:
|
||||
apply_vert_layout(parent);
|
||||
break;
|
||||
case L_TABBED:
|
||||
apply_tabbed_layout(parent);
|
||||
break;
|
||||
default:
|
||||
wlr_log(L_DEBUG, "TODO: arrange layout type %d", parent->layout);
|
||||
apply_horiz_layout(parent);
|
||||
|
|
|
|||
|
|
@ -234,6 +234,7 @@ static bool is_parallel(enum sway_container_layout layout,
|
|||
enum movement_direction dir) {
|
||||
switch (layout) {
|
||||
case L_TABBED:
|
||||
return dir == MOVE_LEFT || dir == MOVE_RIGHT;
|
||||
case L_STACKED:
|
||||
case L_HORIZ:
|
||||
return dir == MOVE_LEFT || dir == MOVE_RIGHT;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue