From 8036be52dcd830fac44cca4e780ef16d208ed940 Mon Sep 17 00:00:00 2001 From: Bryan Hyland Date: Sun, 17 Nov 2024 10:08:46 -0800 Subject: [PATCH] Update example with comments --- examples/spin-button/src/main.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/spin-button/src/main.rs b/examples/spin-button/src/main.rs index 6752e6f6..cc6b4f84 100644 --- a/examples/spin-button/src/main.rs +++ b/examples/spin-button/src/main.rs @@ -90,13 +90,13 @@ impl Application for VertSpinnerApp { fn view(&self) -> Element { let vert_spinner_row = row![ spin_button( - "i8", - 1, - self.i8_num, - -5, - 5, - Direction::Vertical, - SpinBtnMessages::UpdateI8Num + "i8", // label: displayed above the widget no matter the orientation + 1, // step: how much to increment/decrement by + self.i8_num, // current value, this is also what's displayed in the center of the widget + -5, // minimum value, if decremented below this the widget's current value rolls to the max value + 5, // maximum value, if incremented above this the widget's current value rolls to the min value + Direction::Vertical, // oreintation of the widget + SpinBtnMessages::UpdateI8Num // message to send to the application's update function ), spin_button( "i16",