| 1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
| 2 | // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 |
| 3 | |
| 4 | import { TabWidget } from "std-widgets.slint" ; |
| 5 | |
| 6 | TestCase := Window { |
| 7 | preferred_height: 500px; |
| 8 | preferred_width: 500px; |
| 9 | |
| 10 | property <int> current_tab: tw.current-index; |
| 11 | |
| 12 | VerticalLayout { |
| 13 | padding: 20px; |
| 14 | tw := TabWidget { |
| 15 | current-index: 1; |
| 16 | Tab { |
| 17 | title: "Hello" ; |
| 18 | Rectangle { |
| 19 | background: #8555; |
| 20 | } |
| 21 | |
| 22 | } |
| 23 | Tab { |
| 24 | title: "World" ; |
| 25 | Text { text: "This is the second widget" ; } |
| 26 | } |
| 27 | Tab { |
| 28 | title: "Third" ; |
| 29 | Rectangle { |
| 30 | background: pink; |
| 31 | } |
| 32 | min_height: 200px; |
| 33 | } |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | property <bool> test: tw.vertical_stretch == 1 && tw.horizontal_stretch == 1 && tw.min_height > 200px && current-tab == 1; |
| 38 | } |
| 39 | |