Fix scrolling not working with missing mouse config

This commit is contained in:
Ivan Molodetskikh
2024-11-10 09:14:22 +03:00
parent 9d8f640503
commit 1951d2a9f2
2 changed files with 10 additions and 9 deletions
+6 -6
View File
@@ -188,8 +188,8 @@ pub struct Touchpad {
pub disabled_on_external_mouse: bool,
#[knuffel(child)]
pub middle_emulation: bool,
#[knuffel(child, unwrap(argument), default = FloatOrInt(1.0))]
pub scroll_factor: FloatOrInt<0, 100>,
#[knuffel(child, unwrap(argument))]
pub scroll_factor: Option<FloatOrInt<0, 100>>,
}
#[derive(knuffel::Decode, Debug, Default, PartialEq)]
@@ -210,8 +210,8 @@ pub struct Mouse {
pub left_handed: bool,
#[knuffel(child)]
pub middle_emulation: bool,
#[knuffel(child, unwrap(argument), default = FloatOrInt(1.0))]
pub scroll_factor: FloatOrInt<0, 100>,
#[knuffel(child, unwrap(argument))]
pub scroll_factor: Option<FloatOrInt<0, 100>>,
}
#[derive(knuffel::Decode, Debug, Default, PartialEq)]
@@ -3183,7 +3183,7 @@ mod tests {
left_handed: false,
disabled_on_external_mouse: true,
middle_emulation: false,
scroll_factor: FloatOrInt(0.9),
scroll_factor: Some(FloatOrInt(0.9)),
},
mouse: Mouse {
off: false,
@@ -3194,7 +3194,7 @@ mod tests {
scroll_button: Some(273),
left_handed: false,
middle_emulation: true,
scroll_factor: FloatOrInt(0.2),
scroll_factor: Some(FloatOrInt(0.2)),
},
trackpoint: Trackpoint {
off: true,