forked from slint-ui/slint
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscene.slint
79 lines (67 loc) · 2.25 KB
/
scene.slint
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Copyright © SixtyFPS GmbH <[email protected]>
// SPDX-License-Identifier: MIT
import { Slider, GroupBox, HorizontalBox, VerticalBox, GridBox } from "std-widgets.slint";
export component App inherits Window {
in property <image> texture <=> image.source;
out property <int> requested-texture-width: image.width/1phx;
out property <int> requested-texture-height: image.height/1phx;
out property <float> selected-red <=> red.value;
out property <float> selected-green <=> green.value;
out property <float> selected-blue <=> blue.value;
preferred-width: 500px;
preferred-height: 600px;
title: "Slint OpenGL Texture Example";
icon: @image-url("../../logo/slint-logo-small-light.png");
VerticalBox {
Text {
text: "This text is rendered using Slint. The rotating cube below is rendered into an OpenGL texture.";
wrap: word-wrap;
}
image := Image {
preferred-width: 640px;
preferred-height: 640px;
min-width: 64px;
min-height: 64px;
width: 100%;
//height: 100%;
}
GroupBox {
title: "Cube Color Controls";
GridBox {
Row {
Text {
text: "Red:";
vertical-alignment: center;
}
red := Slider {
minimum: 0.1;
maximum: 1.0;
value: 0.2;
}
}
Row {
Text {
text: "Green:";
vertical-alignment: center;
}
green := Slider {
minimum: 0.1;
maximum: 1.0;
value: 0.5;
}
}
Row {
Text {
text: "Blue:";
vertical-alignment: center;
}
blue := Slider {
minimum: 0.1;
maximum: 1.0;
value: 0.9;
}
}
}
}
}
}