mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
Extract SizeChange::from(PresetSize)
This commit is contained in:
@@ -768,6 +768,15 @@ pub enum PresetSize {
|
||||
Fixed(#[knuffel(argument)] i32),
|
||||
}
|
||||
|
||||
impl From<PresetSize> for SizeChange {
|
||||
fn from(value: PresetSize) -> Self {
|
||||
match value {
|
||||
PresetSize::Proportion(prop) => SizeChange::SetProportion(prop * 100.),
|
||||
PresetSize::Fixed(fixed) => SizeChange::SetFixed(fixed),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
pub struct DefaultPresetSize(pub Option<PresetSize>);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user