Changeset View
Changeset View
Standalone View
Standalone View
tests/components/button3.qml
1 | import QtQuick 2.0 | 1 | import QtQuick 2.0 | ||
---|---|---|---|---|---|
2 | 2 | | |||
3 | import org.kde.plasma.components 3.0 as PlasmaComponents | 3 | import org.kde.plasma.components 3.0 as PlasmaComponents | ||
4 | import QtQuick.Layouts 1.2 | 4 | import QtQuick.Layouts 1.2 | ||
5 | 5 | | |||
6 | Rectangle | 6 | ComponentBase { | ||
7 | { | | |||
8 | width: 500 | | |||
9 | height: 500 | | |||
10 | color: "white" | | |||
11 | | ||||
12 | Grid { | 7 | Grid { | ||
13 | anchors.fill: parent | 8 | anchors.fill: parent | ||
14 | anchors.margins: 20 | 9 | anchors.margins: 20 | ||
15 | spacing: 20 | 10 | spacing: 20 | ||
16 | columns: 2 | 11 | columns: 2 | ||
17 | 12 | | |||
18 | Label { | 13 | PlasmaComponents.Label { | ||
19 | text: "icon + text" | 14 | text: "icon + text" | ||
20 | } | 15 | } | ||
21 | 16 | | |||
22 | PlasmaComponents.Button { | 17 | PlasmaComponents.Button { | ||
23 | icon.name: "list-remove" | 18 | icon.name: "list-remove" | ||
24 | text: "test" | 19 | text: "test" | ||
25 | } | 20 | } | ||
26 | 21 | | |||
27 | Label { | 22 | PlasmaComponents.Label { | ||
28 | text: "icon alone, should look small and square" | 23 | text: "icon alone, should look small and square" | ||
29 | } | 24 | } | ||
30 | 25 | | |||
31 | PlasmaComponents.Button { | 26 | PlasmaComponents.Button { | ||
32 | icon.name: "list-remove" | 27 | icon.name: "list-remove" | ||
33 | } | 28 | } | ||
34 | 29 | | |||
35 | Label { | 30 | PlasmaComponents.Label { | ||
36 | text: "text alone, should be about 12 chars wide" | 31 | text: "text alone, should be about 12 chars wide" | ||
37 | } | 32 | } | ||
38 | 33 | | |||
39 | PlasmaComponents.Button { | 34 | PlasmaComponents.Button { | ||
40 | text: "test" | 35 | text: "test" | ||
41 | } | 36 | } | ||
42 | 37 | | |||
43 | 38 | | |||
44 | Label { | 39 | PlasmaComponents.Label { | ||
45 | text: "long text, should expand to fit" | 40 | text: "long text, should expand to fit" | ||
46 | } | 41 | } | ||
47 | 42 | | |||
48 | PlasmaComponents.Button { | 43 | PlasmaComponents.Button { | ||
49 | icon.name: "list-remove" | 44 | icon.name: "list-remove" | ||
50 | text: "This is a really really really really long button" | 45 | text: "This is a really really really really long button" | ||
51 | } | 46 | } | ||
52 | 47 | | |||
53 | Label { | 48 | PlasmaComponents.Label { | ||
54 | text: "long text but constrained, should be 150px and elided" | 49 | text: "long text but constrained, should be 150px and elided" | ||
55 | } | 50 | } | ||
56 | 51 | | |||
57 | PlasmaComponents.Button { | 52 | PlasmaComponents.Button { | ||
58 | icon.name: "list-remove" | 53 | icon.name: "list-remove" | ||
59 | text: "This is a really really really really long button" | 54 | text: "This is a really really really really long button" | ||
60 | width: 150 | 55 | width: 150 | ||
61 | } | 56 | } | ||
62 | 57 | | |||
63 | 58 | | |||
64 | Label { | 59 | PlasmaComponents.Label { | ||
65 | text: "button (with or without icon) and textfield should have the same height" | 60 | text: "button (with or without icon) and textfield should have the same height" | ||
66 | } | 61 | } | ||
67 | 62 | | |||
68 | RowLayout { | 63 | RowLayout { | ||
69 | PlasmaComponents.Button { | 64 | PlasmaComponents.Button { | ||
70 | text: "test" | 65 | text: "test" | ||
71 | } | 66 | } | ||
72 | PlasmaComponents.Button { | 67 | PlasmaComponents.Button { | ||
73 | icon.name: "application-menu" | 68 | icon.name: "application-menu" | ||
74 | text: "test" | 69 | text: "test" | ||
75 | } | 70 | } | ||
76 | PlasmaComponents.TextField { | 71 | PlasmaComponents.TextField { | ||
77 | } | 72 | } | ||
78 | } | 73 | } | ||
79 | 74 | | |||
80 | Label { | 75 | PlasmaComponents.Label { | ||
81 | text: "minimum width property. Should be two letters wide" | 76 | text: "minimum width property. Should be two letters wide" | ||
82 | } | 77 | } | ||
83 | 78 | | |||
84 | RowLayout { | 79 | RowLayout { | ||
85 | PlasmaComponents.Button { | 80 | PlasmaComponents.Button { | ||
86 | text: "AA" | 81 | text: "AA" | ||
87 | // implicitWidth: minimumWidth FIXME, there is no equivalent? | 82 | // implicitWidth: minimumWidth FIXME, there is no equivalent? | ||
88 | } | 83 | } | ||
89 | } | 84 | } | ||
90 | 85 | | |||
91 | } | 86 | } | ||
92 | } | 87 | } | ||
93 | 88 | |