mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-18 23:09:53 +02:00
This commit introduces a new Trait, Dimensions, which requires the implementation of a fn calculate() -> Vec<Rect>, a fn that was previously limited to the Layout struct. Dimensions is now implemented both for Layout and the new CustomLayout struct, the latter being a general adaptive fn which employs a number of fallbacks to sane defaults when the the layout does not have the minimum number of required windows on the screen. The CustomLayout is mainly intended for use on ultra and superultrawide monitors, and as such uses columns as a basic building block. There are three Column variants: Primary, Secondary and Tertiary. The Primary column will typically be somewhere in the middle of the layout, and will be where a window is placed when promoted using the komorebic command. The Secondary column is optional, and can be used one or more times in a layout, either splitting to accomodate a certain number of windows horizontally or vertically, or not splitting at all. The Tertiary window is the final window, which will typically be on the right of a layout, which must be split either horizontally or vertically to accomodate as many windows as necessary. The Tertiary column will only be rendered when the threshold of windows required to enable it has been met. Until then, the rightmost Primary or Secondary column will expand to take its place. If there are less windows than (or a number equal to the) columns defined in the layout, the windows will be arranged in a basic columnar layout until the number of windows is greater than the number of columns defined in the layout. At this point, although the calculation logic has been completed, work must be done on the navigation logic before a SocketMessage variant can be added for loading custom layouts from files.