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