From 65560825facaa269c239476a0fad95362af39285 Mon Sep 17 00:00:00 2001 From: uttarayan21 Date: Fri, 22 Aug 2025 13:06:16 +0530 Subject: [PATCH] feat: add cargo-outdated and improve slider precision in app views --- flake.nix | 1 + src/gui/app.rs | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/flake.nix b/flake.nix index f38df5b..c4ca2f8 100644 --- a/flake.nix +++ b/flake.nix @@ -204,6 +204,7 @@ [ stableToolchainWithRustAnalyzer cargo-expand + cargo-outdated cargo-nextest cargo-deny cmake diff --git a/src/gui/app.rs b/src/gui/app.rs index bfcb87b..a537192 100644 --- a/src/gui/app.rs +++ b/src/gui/app.rs @@ -418,7 +418,7 @@ impl FaceDetectorApp { } } - fn view(&self) -> Element { + fn view(&self) -> Element<'_, Message> { let tabs = row![ button("Detection") .on_press(Message::TabChanged(Tab::Detection)) @@ -472,7 +472,7 @@ impl FaceDetectorApp { } impl FaceDetectorApp { - fn detection_view(&self) -> Element { + fn detection_view(&self) -> Element<'_, Message> { let file_section = column![ text("Input Image").size(18), row![ @@ -581,14 +581,14 @@ impl FaceDetectorApp { text("Detection Parameters").size(18), row![ text("Threshold:"), - slider(0.1..=1.0, self.threshold, Message::ThresholdChanged), + slider(0.1..=1.0, self.threshold, Message::ThresholdChanged).step(0.01), text(format!("{:.2}", self.threshold)), ] .spacing(10) .align_y(Alignment::Center), row![ text("NMS Threshold:"), - slider(0.1..=1.0, self.nms_threshold, Message::NmsThresholdChanged), + slider(0.1..=1.0, self.nms_threshold, Message::NmsThresholdChanged).step(0.01), text(format!("{:.2}", self.nms_threshold)), ] .spacing(10) @@ -633,7 +633,7 @@ impl FaceDetectorApp { .into() } - fn comparison_view(&self) -> Element { + fn comparison_view(&self) -> Element<'_, Message> { let file_section = column![ text("Image Comparison").size(18), row![ @@ -742,14 +742,14 @@ impl FaceDetectorApp { text("Comparison Parameters").size(18), row![ text("Threshold:"), - slider(0.1..=1.0, self.threshold, Message::ThresholdChanged), + slider(0.1..=1.0, self.threshold, Message::ThresholdChanged).step(0.01), text(format!("{:.2}", self.threshold)), ] .spacing(10) .align_y(Alignment::Center), row![ text("NMS Threshold:"), - slider(0.1..=1.0, self.nms_threshold, Message::NmsThresholdChanged), + slider(0.1..=1.0, self.nms_threshold, Message::NmsThresholdChanged).step(0.01), text(format!("{:.2}", self.nms_threshold)), ] .spacing(10) @@ -822,7 +822,7 @@ impl FaceDetectorApp { .into() } - fn settings_view(&self) -> Element { + fn settings_view(&self) -> Element<'_, Message> { let executor_options = vec![ ExecutorType::MnnCpu, ExecutorType::MnnMetal, @@ -846,14 +846,14 @@ impl FaceDetectorApp { text("Detection Thresholds").size(18), row![ text("Detection Threshold:"), - slider(0.1..=1.0, self.threshold, Message::ThresholdChanged), + slider(0.1..=1.0, self.threshold, Message::ThresholdChanged).step(0.01), text(format!("{:.2}", self.threshold)), ] .spacing(10) .align_y(Alignment::Center), row![ text("NMS Threshold:"), - slider(0.1..=1.0, self.nms_threshold, Message::NmsThresholdChanged), + slider(0.1..=1.0, self.nms_threshold, Message::NmsThresholdChanged).step(0.01), text(format!("{:.2}", self.nms_threshold)), ] .spacing(10)