Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

optional weights parameter in apply() method #14

Open
hertg opened this issue Feb 26, 2023 · 0 comments
Open

optional weights parameter in apply() method #14

hertg opened this issue Feb 26, 2023 · 0 comments

Comments

@hertg
Copy link
Member

hertg commented Feb 26, 2023

Note

Not approved, just an idea for now

Introduce an optional weights: Vec<f32> parameter to the layout apply() method.

pub fn apply(definition: &Layout, window_count: usize, container: &Rect) -> Vec<Rect> {

The weights could be passed down to the layout calculations and allow windows in a stack to have different sizes based on their weight. The reason for passing in weights via parameters instead of keeping them as a property of the layout-definition is that an end-user is more likely interested in changing the weight of a particular application (a window), not a specific tile inside the layout. Since applications are moved and occupy different tiles during their lifetime, keeping the weight as a property of a specific tile seems wrong. Since the layouts library does not know anything about applications or windows, keeping the list (and order) of weights for particular application is outside the scope of this library and therefore not its responsibility.

@hertg hertg changed the title optional weights parameter to apply() for optional weights parameter in apply() method Feb 26, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant