1 | #![allow (deprecated)]slint::slint!{#[include_path=r#"/input/slint/tests/driver/driverlib/../../cases/examples"# ] |
2 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
3 | // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial |
4 | |
5 | Btn := Rectangle { |
6 | property<string> button_text; |
7 | callback clicked; |
8 | width: 100phx; |
9 | height: 75phx; |
10 | TouchArea { |
11 | width: 100phx; |
12 | height: 75phx; |
13 | clicked => { root.clicked() } |
14 | } |
15 | Text { |
16 | x: 50phx; |
17 | y: 10phx; |
18 | text: button_text; |
19 | color: black; |
20 | } |
21 | } |
22 | |
23 | PlusMinus := Rectangle { |
24 | width: 100phx; |
25 | height: 300phx; |
26 | background: white; |
27 | |
28 | property<int> counter; |
29 | |
30 | GridLayout { |
31 | Row { |
32 | Btn { |
33 | clicked => { counter -= 1 } |
34 | button_text: "-" ; |
35 | } |
36 | } |
37 | Row { |
38 | Text { |
39 | text: counter; |
40 | color: black; |
41 | } |
42 | } |
43 | Row { |
44 | Btn { |
45 | clicked => { counter += 1 } |
46 | button_text: "+" ; |
47 | } |
48 | } |
49 | } |
50 | } |
51 | } |
52 | |