Slider

Slider小部件是一个多功能的滑块组件,支持各种滑块类型(水平、垂直和旋转)。它与TextInput集成以实现精确的值输入,并支持动画、自定义绘图和事件处理以实现交互式用户体验。

The Slider widget is a versatile slider component that supports various slider types (horizontal, vertical, and rotary). It integrates with a TextInput for precise value entry and supports animations, custom drawing, and event handling for interactive user experiences.

Props

decoratenametypedescription
redraw, livedraw_sliderDrawSliderProperties for drawing the slider.
walkwalkWalkLayout and positioning properties.
layoutlayoutLayoutLayout properties for arranging child elements.
animatoranimatorAnimatorAnimator for handling animation states.
livelabel_walkWalkWalk properties for the label.
livelabel_alignAlignAlignment properties for the label.
livedraw_textDrawTextProperties for drawing the text.
livetextStringThe text content displayed by the slider.
livetext_inputTextInputEmbedded text input for precise value entry.
liveprecisionusizeNumber of decimal places for the displayed value.
liveminf64Minimum value of the slider.
livemaxf64Maximum value of the slider.
livestepf64Step size for the slider.
livedefaultf64Default value of the slider.
livebindStringBinding identifier for data binding.
rustvaluef64Current value of the slider.
rustdraggingOption<f64>Indicates if the slider is currently being dragged.

See DrawSlider

Event

namedescription
StartSlideTriggered when the user starts sliding.
TextSlide(f64)Triggered when the text input value changes, updating the slider.
Slide(f64)Triggered when the slider value changes.
EndSlideTriggered when the user ends sliding.
NoneRepresents no action.