Tree layout and focus direction - #147
Conversation
Adding `activate_tile_by_direction` to `workspace.rs`. When the `FocusWindow<DIRECTION>` key is pressed, we pass a normalized direction vector into the function. Then we get the vector from the center of our current window to the center of other windows in the workspace. We calculate the dot product, which will let us figure out how similar our direction vector is to the angle between our two windows. We then pick the window that has the smallest difference. In the case of a bunch of windows stacked together, we also factor in distance so that nearer windows are prioritized over ones that are further away. Also made tree layouts available for config, as well as some other key actions I hadn't included yet
|
Hey, this looks amazing! I appreciate very much the effort. Nothing to comment much on the implementation itself, you kept the interface as I would in If needed, you can perhaps add a enum LayoutData {
BinarySpace(Tree),
None, // other dynamic layouts, that don't need any data.
}What I have planned is also to move stuff inside a Looking forward to using this btw! |
|
I'm glad you like it! Can I ask for more info about the possible |
Nothing, just a suggestion really. If you wish to continue working on it, feel free todo so! |
Hi! It's been a while, but I had a lot of personal matters that took me away from working on these features. I think this is in a good state. I've moved the binary space partition work to this branch instead, along with some additional stuff.
I've tested these features, the layouts work fine. Currently, focus direction switching is also good, but the algorithm can be refined a bit. I can come back to that. Additionally, I'm planning to implement window swapping by direction as well, but I'll add that another time. Let me know what you think!