From 39e14d8c93a9c5c9d59fb6a16b7b42afd9cbfc03 Mon Sep 17 00:00:00 2001 From: Mark LeMoine Date: Fri, 7 Jun 2019 09:47:48 -0700 Subject: [PATCH] Add getters for current and max value in SliderView (#353) --- src/views/slider_view.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/views/slider_view.rs b/src/views/slider_view.rs index f030fd2..3beabf2 100644 --- a/src/views/slider_view.rs +++ b/src/views/slider_view.rs @@ -63,6 +63,16 @@ impl SliderView { }) } + /// Gets the current value. + pub fn get_value(&self) -> usize { + self.value + } + + /// Gets the max value. + pub fn get_max_value(&self) -> usize { + self.max_value + } + /// Sets a callback to be called when the slider is moved. pub fn on_change(mut self, callback: F) -> Self where