1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
---|---|
2 | // SPDX-License-Identifier: MIT |
3 | |
4 | import { Button, LineEdit, HorizontalBox } from "std-widgets.slint"; |
5 | |
6 | export component Counter inherits Window { |
7 | private property <int> value: 0; |
8 | |
9 | preferred-height: 30px; |
10 | |
11 | layout := HorizontalBox { |
12 | LineEdit { |
13 | enabled: false; |
14 | text: root.value; |
15 | } |
16 | |
17 | Button { |
18 | clicked => { root.value += 1; } |
19 | text: "Count"; |
20 | } |
21 | } |
22 | } |
23 |