mirror of
https://codeberg.org/vyn/selenite.git
synced 2025-07-02 01:23:23 +00:00
First commit
This commit is contained in:
commit
dd0c8c326a
16 changed files with 534 additions and 0 deletions
34
Slider.slint
Normal file
34
Slider.slint
Normal file
|
@ -0,0 +1,34 @@
|
|||
import { VLabeledComponent } from "LabeledComponent.slint";
|
||||
import { Palette } from "Palette.slint";
|
||||
import { Slider } from "std-widgets.slint";
|
||||
import { VText } from "Text.slint";
|
||||
|
||||
export component VSlider inherits VLabeledComponent {
|
||||
in property <bool> show-value;
|
||||
in-out property <float> value;
|
||||
|
||||
init => {
|
||||
sliderComponent.value = root.value;
|
||||
}
|
||||
|
||||
pure callback format-value(float) -> string;
|
||||
format-value(value) => {
|
||||
return "\{value}";
|
||||
}
|
||||
|
||||
callback released <=> sliderComponent.released;
|
||||
in property minimum <=> sliderComponent.minimum;
|
||||
in property maximum <=> sliderComponent.maximum;
|
||||
|
||||
VerticalLayout {
|
||||
spacing: 8px;
|
||||
VText {
|
||||
horizontal-alignment: center;
|
||||
text: format-value(sliderComponent.value);
|
||||
color: Palette.foreground-hint;
|
||||
}
|
||||
sliderComponent := Slider {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue