mirror of
https://github.com/enso-org/enso.git
synced 2024-11-27 18:12:31 +03:00
b2b60612d7
This is an enhancement of the `Slider` component implemented in #3852. It adds the following features: * Tooltips and precision change hints * Selectable slider limit behaviors * Textual slider value editing * Vertical slider layout #### Tooltips An information tooltip can now be added to a slider, it is shown when the mouse hovers over the component. Additionally, a pop-up indicating the slider's precision appears when the slider's precision has been adjusted. https://user-images.githubusercontent.com/117099775/206148098-3b4dc059-18aa-4200-9ee0-5d4382363810.mp4 #### Slider limits The previous slider implementation clamped the adjusted value to the slider's minimum/maximum limits. Now the following behaviors are available: * Hard limits: Clamp the value to a range within the slider's limits. * Soft limits: The value can extend beyond the slider's limits. When this occurs, an overflow indicator will be displayed on the side of the limit that is exceeded. * Adaptive limits: The value can extend beyond the slider's limits. When this occurs, the exceeded limit will temporarily be adjusted to double the slider's range. This will be performed iteratively until the value falls within the extended limits. When a limit is extended and the value is adjusted to fit a smaller range, the extended limit will be iteratively halved until only the necessary range is covered. The slider's extended limits will never shrink to a range smaller than the original range. These behaviors can be set to the lower and upper limits of a slider independently. https://user-images.githubusercontent.com/117099775/206148139-6149c91d-ef49-4e2d-97f6-71084f52591c.mp4 #### Textual editing The slider's value can now be entered through a text input field. Double-click to edit the slider's current value. To confirm the edit press `enter`, or press `escape` to cancel the edit. If an invalid value is entered on confirmation the slider will revert to its value before the edit. The slider's precision will be adjusted based on the number of decimal places of the value entered. https://user-images.githubusercontent.com/117099775/206148170-d3fa4c82-6e73-4b1c-9be9-cb99979f7b70.mp4 #### Vertical layout The slider component now supports a vertical layout. In this case value adjustment is performed by a vertical mouse movement, and a horizontal movement adjusts the slider's precision. The slider's track now fills the component in a vertical direction, and the slider's label is displayed near the top end of the component. https://user-images.githubusercontent.com/117099775/206148211-0f176aaf-bc1b-45e2-afd7-0d28391aafcb.mp4 #### Scroll bar mode The slider component supports two indicator modes: * `Track`: The component is filled with a colored bar from the lower limit (empty) to the upper limit (full) dependent on the slider's value. * `Thumb`: The component contains a rounded indicator that moves along the slider from one end to the other, indicating the slider's value proportionally to the slider's limits. The width of the indicator is configurable. In addition, the value text, text entry, and precision adjustment can be turned off to provide a scroll bar appearance when used with the `Thumb` indicator. https://user-images.githubusercontent.com/117099775/206148261-ae291073-85e9-4082-9f91-39b65fecdc0f.mp4 #### Example scene shortcuts The example scene contains two shortcuts in order to evaluate the dynamic addition and removal of the slider components: * `CTRL+D` drops all the slider components that are added to the scene. * `CTRL+A` adds a new set of example slider components to the scene.
12 lines
348 B
YAML
12 lines
348 B
YAML
# Options intended to be common for all developers.
|
|
|
|
wasm-size-limit: 15.15 MiB
|
|
|
|
required-versions:
|
|
cargo-watch: ^8.1.1
|
|
node: =18.12.1
|
|
wasm-pack: ^0.10.2
|
|
# TODO [mwu]: Script can install `flatc` later on (if `conda` is present), so this is not required. However it should
|
|
# be required, if `conda` is missing.
|
|
# flatc: =1.12.0
|