Flatten tree - #950
Conversation
fc6e3a4 to
9af9b78
Compare
|
Please make this a tristate Never, Always, OnRemove where OnRemove only takes effect when the second-to-last child of a container is removed. This requires adding a non_exhaustive enum to jay-config and a corresponding enum in Jay proper.
You also have to add a corresponding setting in the look-and-feel pane in the control center. |
|
Is the difference between Always and OnRemove that OnRemove lets you manually nest a single child deep in a tree? Always should be closest to how i3 behaves. |
Yes. |
9af9b78 to
1fe576e
Compare
| if state.split_reuses_container.get() | ||
| && let Some(pn) = toplevel_parent_container(&*tl) | ||
| && pn.node_state[LiveTL].num_children.get() == 1 | ||
| { | ||
| pn.set_split(axis); | ||
| return; | ||
| } | ||
| let pn = match tl.tl_data().parent.get() { | ||
| Some(pn) => pn, | ||
| _ => return, | ||
| }; | ||
| let reuse = state.split_reuses_container.get() | ||
| || state.flatten_tree.get() == crate::state::FlattenTree::Always; | ||
| if let Some(container) = pn.clone().node_into_container() | ||
| && container.num_children() == 1 | ||
| && reuse | ||
| { | ||
| container.set_split(axis); | ||
| return; | ||
| } |
| show_bar: show_bar.despan(), | ||
| split_reuses_container: split_reuses_container.despan(), | ||
| show_titles: show_titles.despan(), | ||
| flatten_tree: flatten_tree.as_ref().map(|v| parse_flatten_tree(v)), |
There was a problem hiding this comment.
Use the same style as the other settings above.
1fe576e to
5bd6e0e
Compare
closes #944