mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-05-16 16:57:02 +02:00
feat(wm): allow f32 width % for custom layouts
This commit allows users to provide an f32 value for the WidthPercentage on the primary column of a custom layout.
This commit is contained in:
@@ -683,15 +683,15 @@ impl WindowManager {
|
||||
if matches!(axis, Axis::Horizontal) {
|
||||
let percentage = custom
|
||||
.primary_width_percentage()
|
||||
.unwrap_or(100 / custom.len());
|
||||
.unwrap_or(100.0 / (custom.len() as f32));
|
||||
|
||||
if no_layout_rules {
|
||||
match sizing {
|
||||
Sizing::Increase => {
|
||||
custom.set_primary_width_percentage(percentage + 5);
|
||||
custom.set_primary_width_percentage(percentage + 5.0);
|
||||
}
|
||||
Sizing::Decrease => {
|
||||
custom.set_primary_width_percentage(percentage - 5);
|
||||
custom.set_primary_width_percentage(percentage - 5.0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -700,10 +700,10 @@ impl WindowManager {
|
||||
if let Layout::Custom(ref mut custom) = rule.1 {
|
||||
match sizing {
|
||||
Sizing::Increase => {
|
||||
custom.set_primary_width_percentage(percentage + 5);
|
||||
custom.set_primary_width_percentage(percentage + 5.0);
|
||||
}
|
||||
Sizing::Decrease => {
|
||||
custom.set_primary_width_percentage(percentage - 5);
|
||||
custom.set_primary_width_percentage(percentage - 5.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user