Init with colour sliders in approx position

This commit is contained in:
Luke D. Jones
2024-03-03 12:57:45 +13:00
parent a88c33c201
commit 3da848d131
11 changed files with 198 additions and 217 deletions

View File

@@ -2,10 +2,10 @@ import { VerticalBox , StandardButton, Button, HorizontalBox, ComboBox, Switch,
import { Theme } from "globals.slint";
export component RogItem inherits Rectangle {
background: Theme.background-color;
border-color: Colors.black;
border-width: 3px;
border-radius: 10px;
background: Theme.background-color;
border-color: Colors.black;
border-width: 3px;
border-radius: 10px;
}
export component SystemSlider inherits RogItem {
@@ -122,8 +122,7 @@ export component ValueBar inherits Rectangle {
return 0.50 - (value - (min - max) / 2) / (max - min);
}
return (value - min) / (max - min);
}
function set_x(min: float, max: float, value: float, width: length) -> length {
}function set_x(min: float, max: float, value: float, width: length) -> length {
if (min < 0.0 && max > 0.0) {
if (value < max + min) {
return width / 2 - width * (percentage(min, max, value));
@@ -131,8 +130,7 @@ export component ValueBar inherits Rectangle {
return width / 2;
}
return 0;
}
Rectangle {
}Rectangle {
border-radius: 3px;
background: Theme.neutral-box;
Rectangle {