Revert: "tiling: Move window into sibling group, if orientation matches "
This commit is contained in:
parent
9444eed4c3
commit
19c0fad00c
1 changed files with 1 additions and 46 deletions
|
|
@ -632,52 +632,7 @@ impl TilingLayout {
|
||||||
| (Orientation::Vertical, Direction::Up)
|
| (Orientation::Vertical, Direction::Up)
|
||||||
| (Orientation::Vertical, Direction::Down)
|
| (Orientation::Vertical, Direction::Down)
|
||||||
) {
|
) {
|
||||||
if len == 2 {
|
// ...create a new group with our parent (cleanup will remove any one-child-groups afterwards)
|
||||||
if let Some(sibling) = tree
|
|
||||||
.children_ids(&parent)
|
|
||||||
.unwrap()
|
|
||||||
.find(|id| *id != &child_id)
|
|
||||||
.cloned()
|
|
||||||
{
|
|
||||||
let sibling_data = tree.get(&sibling).unwrap().data();
|
|
||||||
if sibling_data.is_group() {
|
|
||||||
let sibling_orientation = sibling_data.orientation();
|
|
||||||
if matches!(
|
|
||||||
(sibling_orientation, direction),
|
|
||||||
(Orientation::Vertical, Direction::Right)
|
|
||||||
| (Orientation::Vertical, Direction::Left)
|
|
||||||
| (Orientation::Horizontal, Direction::Up)
|
|
||||||
| (Orientation::Horizontal, Direction::Down)
|
|
||||||
) && child_id == node_id
|
|
||||||
{
|
|
||||||
// ..lets move into our sibling group instead
|
|
||||||
|
|
||||||
let idx =
|
|
||||||
if direction == Direction::Left || direction == Direction::Up {
|
|
||||||
0
|
|
||||||
} else {
|
|
||||||
sibling_data.len()
|
|
||||||
};
|
|
||||||
tree.move_node(&node_id, MoveBehavior::ToParent(&sibling))
|
|
||||||
.unwrap();
|
|
||||||
tree.make_nth_sibling(&node_id, idx).unwrap();
|
|
||||||
|
|
||||||
tree.get_mut(&sibling).unwrap().data_mut().add_window(idx);
|
|
||||||
tree.get_mut(&og_parent)
|
|
||||||
.unwrap()
|
|
||||||
.data_mut()
|
|
||||||
.remove_window(og_idx);
|
|
||||||
|
|
||||||
let blocker =
|
|
||||||
TilingLayout::update_positions(&output, &mut tree, self.gaps);
|
|
||||||
queue.push_tree(tree, blocker);
|
|
||||||
return None;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// or create a new group with our parent (cleanup will remove any one-child-groups afterwards)
|
|
||||||
TilingLayout::new_group(
|
TilingLayout::new_group(
|
||||||
&mut tree,
|
&mut tree,
|
||||||
&parent,
|
&parent,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue