forked from slint-ui/slint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.slint
44 lines (39 loc) · 1.2 KB
/
main.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
// Copyright © SixtyFPS GmbH <[email protected]>
// SPDX-License-Identifier: MIT
import { Slider, HorizontalBox, VerticalBox, GroupBox, ComboBox } from "std-widgets.slint";
export component MainWindow inherits Window {
in property original-image <=> original.source;
in property filters <=> filter-combo.model;
pure callback filter-image(int) -> image;
title: "Slint Image Filter Integration Example";
preferred-width: 800px;
preferred-height: 600px;
HorizontalBox {
VerticalBox {
Text {
font-size: 20px;
text: "Original Image";
horizontal-alignment: center;
}
original := Image { }
}
VerticalBox {
alignment: center;
filter-combo := ComboBox {
current-value: "Blur";
current-index: 0;
vertical-stretch: 0;
}
}
VerticalBox {
Text {
font-size: 20px;
text: "Filtered Image";
horizontal-alignment: center;
}
Image {
source: filter-image(filter-combo.current-index);
}
}
}
}