1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
2 | // SPDX-License-Identifier: MIT |
3 | |
4 | import { HorizontalBox, VerticalBox, ListView, StandardListView, GroupBox } from "std-widgets.slint" ; |
5 | import { GallerySettings } from "../gallery_settings.slint" ; |
6 | import { Page } from "page.slint" ; |
7 | |
8 | export component ListViewPage inherits Page { |
9 | title: @tr("ListView" ); |
10 | show-enable-switch: false; |
11 | description: @tr("ListViews can be used to display a list of elements. The StandardListBox is like the default ListView just with a default text based definition of the visual items. Both can be imported from \"std-widgets.slint\"" ); |
12 | |
13 | HorizontalBox { |
14 | vertical-stretch: 1; |
15 | GroupBox { |
16 | title: @tr("ListView" ); |
17 | |
18 | ListView { |
19 | vertical-stretch: 0; |
20 | for i in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] : HorizontalBox { |
21 | Image { |
22 | width: 24px; |
23 | source: @image-url("../../thumbsup.png" ); |
24 | } |
25 | Text { |
26 | text: @tr("Item {}" , i); |
27 | } |
28 | } |
29 | } |
30 | } |
31 | |
32 | GroupBox { |
33 | title: @tr("StandardListView" ); |
34 | vertical-stretch: 0; |
35 | |
36 | StandardListView { |
37 | model: [ |
38 | {text: @tr("Lorem" )}, {text: @tr("ipsum" )},{text: @tr("dolor" )},{text: @tr("sit" )},{text: @tr("amet" )},{text: @tr("consetetur" )}, |
39 | {text: @tr("Lorem" )}, {text: @tr("ipsum" )},{text: @tr("dolor" )},{text: @tr("sit" )},{text: @tr("amet" )},{text: @tr("consetetur" )}, |
40 | {text: @tr("Lorem" )}, {text: @tr("ipsum" )},{text: @tr("dolor" )},{text: @tr("sit" )},{text: @tr("amet" )},{text: @tr("consetetur" )}, |
41 | {text: @tr("Lorem" )}, {text: @tr("ipsum" )},{text: @tr("dolor" )},{text: @tr("sit" )},{text: @tr("amet" )},{text: @tr("consetetur" )}, |
42 | {text: @tr("Lorem" )}, {text: @tr("ipsum" )},{text: @tr("dolor" )},{text: @tr("sit" )},{text: @tr("amet" )},{text: @tr("consetetur" )}, |
43 | {text: @tr("Lorem" )}, {text: @tr("ipsum" )},{text: @tr("dolor" )},{text: @tr("sit" )},{text: @tr("amet" )},{text: @tr("consetetur" )}, |
44 | {text: @tr("Lorem" )}, {text: @tr("ipsum" )},{text: @tr("dolor" )},{text: @tr("sit" )},{text: @tr("amet" )},{text: @tr("consetetur" )}, |
45 | ]; |
46 | } |
47 | } |
48 | } |
49 | } |
50 | |