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