diff --git a/Cargo.lock b/Cargo.lock index c55fdea..43e4382 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2394,7 +2394,7 @@ checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" [[package]] name = "rawaccel_convert" version = "0.1.0" -source = "git+https://github.com/Kuuuube/rawaccel_convert.git?rev=371afa8cbd5e01e3eaf5d63294ee513f8df6b89f#371afa8cbd5e01e3eaf5d63294ee513f8df6b89f" +source = "git+https://github.com/Kuuuube/rawaccel_convert.git?rev=7278c0c5dfabb7589323ada92f562615f3e60a70#7278c0c5dfabb7589323ada92f562615f3e60a70" [[package]] name = "rawaccel_convert_gui" diff --git a/Cargo.toml b/Cargo.toml index d28b8a1..f523ec8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -rawaccel_convert = { git = "https://github.com/Kuuuube/rawaccel_convert.git", rev = "371afa8cbd5e01e3eaf5d63294ee513f8df6b89f" } +rawaccel_convert = { git = "https://github.com/Kuuuube/rawaccel_convert.git", rev = "7278c0c5dfabb7589323ada92f562615f3e60a70" } egui = "0.28.1" eframe = { version = "0.28.1", features = [ "default_fonts", "glow", "persistence" ] } env_logger = "0.11.3" diff --git a/src/gui.rs b/src/gui.rs index 0e3be89..6d15db6 100644 --- a/src/gui.rs +++ b/src/gui.rs @@ -83,6 +83,8 @@ pub struct RawaccelConvertGui { #[serde(skip)] points: String, + #[serde(skip)] + libinput_steps: String, } impl Default for RawaccelConvertGui { @@ -93,6 +95,7 @@ impl Default for RawaccelConvertGui { accel_args: AccelArgs::default(), points: String::default(), + libinput_steps: String::default(), } } } @@ -935,6 +938,11 @@ fn add_points_dump(rawaccel_convert_gui: &mut RawaccelConvertGui, ui: &mut egui: }; }); + ui.add_sized( + [ui.available_width(), 1.0], + egui::Label::new("Points").selectable(false), + ); + egui::ScrollArea::vertical() .max_height(100.0) .show(ui, |ui| { @@ -944,6 +952,20 @@ fn add_points_dump(rawaccel_convert_gui: &mut RawaccelConvertGui, ui: &mut egui: ) }); + match rawaccel_convert_gui.accel_args.point_scaling { + PointScaling::Libinput | PointScaling::LibinputDebug => { + ui.add_sized( + [ui.available_width(), 1.0], + egui::Label::new("Steps").selectable(false), + ); + ui.add_sized( + [ui.available_width(), 1.0], + egui::TextEdit::singleline(&mut rawaccel_convert_gui.libinput_steps), + ); + }, + _ => {} + } + let generate_points = ui.add_sized( [ui.available_width(), 1.0], egui::Button::new("Generate Points"), @@ -951,16 +973,17 @@ fn add_points_dump(rawaccel_convert_gui: &mut RawaccelConvertGui, ui: &mut egui: if generate_points.clicked() { let curve = rawaccel_convert::generate_curve::generate_curve(&rawaccel_convert_gui.accel_args); + rawaccel_convert_gui.libinput_steps = curve.step_size.to_string(); rawaccel_convert_gui.points = match rawaccel_convert_gui.accel_args.point_scaling { rawaccel_convert::types::PointScaling::Libinput => { let mut output_string = String::default(); - for point in curve { + for point in curve.points { output_string += &(point.y.to_string() + " "); } output_string } _ => { - format!("{:?}", curve) + format!("{:?}", curve.points) } } }