diff --git a/src/viser/_gui_api.py b/src/viser/_gui_api.py index a198ea39..c99bf58d 100644 --- a/src/viser/_gui_api.py +++ b/src/viser/_gui_api.py @@ -1267,6 +1267,7 @@ def add_slider( visible: bool = True, hint: str | None = None, order: float | None = None, + hideControls: bool = True ) -> GuiSliderHandle[IntOrFloat]: """Add a slider to the GUI. Types of the min, max, step, and initial value should match. @@ -1283,6 +1284,7 @@ def add_slider( visible: Whether the slider is visible. hint: Optional hint to display on hover. order: Optional ordering, smallest values will be displayed first. + hideControls: hide the button control in the number input Returns: A handle that can be used to interact with the GUI element. @@ -1325,6 +1327,7 @@ def add_slider( precision=_compute_precision_digits(step), visible=visible, disabled=disabled, + hideControls=hideControls, _marks=tuple( GuiSliderMark(value=float(x[0]), label=x[1]) if isinstance(x, tuple) diff --git a/src/viser/_messages.py b/src/viser/_messages.py index 8ff0faf9..d90ee786 100644 --- a/src/viser/_messages.py +++ b/src/viser/_messages.py @@ -949,6 +949,8 @@ class GuiSliderProps(GuiBaseProps): step: float """Step size for the slider. Synchronized automatically when assigned.""" precision: int + """display the controls on input number""" + hideControls: bool """Number of decimal places to display for the slider value. Synchronized automatically when assigned.""" _marks: Optional[Tuple[GuiSliderMark, ...]] = None """(Private) Optional tuple of GuiSliderMark objects to display custom marks on the slider. Synchronized automatically when assigned.""" diff --git a/src/viser/client/index.html b/src/viser/client/index.html index a40e4e7e..833f8036 100644 --- a/src/viser/client/index.html +++ b/src/viser/client/index.html @@ -1,35 +1,64 @@ -
- - - + + - - - - - - - -