First commit

This commit is contained in:
Vyn 2024-10-16 11:40:45 +02:00
commit dd0c8c326a
16 changed files with 534 additions and 0 deletions

34
Slider.slint Normal file
View 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 {
}
}
}