mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-03-26 19:31:16 +01:00
This commit introduces a number of refactors to layouts in general in order to enable navigation across custom layouts and integrate both default and custom layouts cleanly into komorebi and komorebic. Layout has been renamed to DefaultLayout, and Layout is now an enum with the variants Default and Custom, both of which implement the new traits Arrangement (for layout calculation) and Direction (for operation destination calculation). CustomLayout has been simplified to wrap Vec<Column> and no longer requires the primary column index to be explicitly defined as this can be looked up at runtime for any valid CustomLayout. Given the focus on ultrawide layouts for this feature, I have disabled (and have not yet written the logic for) vertical column splits in custom layouts. Since CustomLayouts will be loaded from a file path, a bunch of clap-related code generation stuff has been removed from the related enums and structs. Layout flipping has not yet been worked on for custom layouts. When switching between Default and Custom layout variants, the primary column index and the 0 element are swapped to ensure that the same window container is always at the focal point of every layout. Resizing/dragging to resize is in a bit of weird spot at the moment because the logic is only implemented for DefaultLayout::BSP right now and nothing else. I think eventually this will need to be extracted to a Resize trait and implemented on everything.