Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/ListItemBase.qml
Show All 33 Lines | |||||
34 | PlasmaComponents.ListItem { | 34 | PlasmaComponents.ListItem { | ||
35 | id: item | 35 | id: item | ||
36 | 36 | | |||
37 | property alias label: textLabel.text | 37 | property alias label: textLabel.text | ||
38 | property alias draggable: dragArea.enabled | 38 | property alias draggable: dragArea.enabled | ||
39 | property alias icon: clientIcon.source | 39 | property alias icon: clientIcon.source | ||
40 | property string type | 40 | property string type | ||
41 | 41 | | |||
42 | anchors { | | |||
43 | left: parent.left; | | |||
44 | right: parent.right; | | |||
45 | } | | |||
46 | | ||||
47 | checked: dropArea.containsDrag | 42 | checked: dropArea.containsDrag | ||
48 | opacity: (draggedStream && draggedStream.deviceIndex == Index) ? 0.3 : 1.0 | 43 | opacity: (draggedStream && draggedStream.deviceIndex == Index) ? 0.3 : 1.0 | ||
49 | 44 | | |||
50 | ListView.delayRemove: dragArea.dragActive | 45 | ListView.delayRemove: dragArea.dragActive | ||
51 | 46 | | |||
52 | DragAndDrop.DropArea { | 47 | Item { | ||
53 | id: dropArea | 48 | width: parent.width | ||
54 | anchors.fill: parent | 49 | height: rowLayout.height | ||
55 | enabled: draggedStream | | |||
56 | | ||||
57 | onDragEnter: { | | |||
58 | if (draggedStream.deviceIndex == Index) { | | |||
59 | event.ignore(); | | |||
60 | } | | |||
61 | } | | |||
62 | | ||||
63 | onDrop: { | | |||
64 | draggedStream.deviceIndex = Index; | | |||
65 | } | | |||
66 | } | | |||
67 | | ||||
68 | MouseArea { | | |||
69 | anchors.fill: parent | | |||
70 | acceptedButtons: Qt.MiddleButton | | |||
71 | onClicked: Muted = !Muted | | |||
72 | } | | |||
73 | | ||||
74 | ColumnLayout { | | |||
75 | property int maximumWidth: parent.width | | |||
76 | width: maximumWidth | | |||
77 | Layout.maximumWidth: maximumWidth | | |||
78 | 50 | | |||
79 | RowLayout { | 51 | RowLayout { | ||
80 | Layout.fillWidth: true | 52 | id: rowLayout | ||
53 | width: parent.width | ||||
81 | spacing: units.smallSpacing | 54 | spacing: units.smallSpacing | ||
82 | 55 | | |||
83 | PlasmaCore.IconItem { | 56 | PlasmaCore.IconItem { | ||
84 | id: clientIcon | 57 | id: clientIcon | ||
85 | Layout.alignment: Qt.AlignHCenter | 58 | Layout.alignment: Qt.AlignHCenter | ||
86 | Layout.preferredHeight: column.height * 0.75 | 59 | Layout.preferredHeight: column.height * 0.75 | ||
87 | Layout.preferredWidth: Layout.preferredHeight | 60 | Layout.preferredWidth: Layout.preferredHeight | ||
88 | source: "unknown" | 61 | source: "unknown" | ||
▲ Show 20 Lines • Show All 128 Lines • ▼ Show 20 Line(s) | 107 | RowLayout { | |||
217 | TextMetrics { | 190 | TextMetrics { | ||
218 | id: percentMetrics | 191 | id: percentMetrics | ||
219 | font: percentText.font | 192 | font: percentText.font | ||
220 | text: i18nc("only used for sizing, should be widest possible string", "100%") | 193 | text: i18nc("only used for sizing, should be widest possible string", "100%") | ||
221 | } | 194 | } | ||
222 | } | 195 | } | ||
223 | } | 196 | } | ||
224 | } | 197 | } | ||
198 | | ||||
199 | DragAndDrop.DropArea { | ||||
200 | id: dropArea | ||||
201 | anchors.fill: parent | ||||
202 | enabled: draggedStream | ||||
203 | | ||||
204 | onDragEnter: { | ||||
205 | if (draggedStream.deviceIndex == Index) { | ||||
206 | event.ignore(); | ||||
207 | } | ||||
208 | } | ||||
209 | | ||||
210 | onDrop: { | ||||
211 | draggedStream.deviceIndex = Index; | ||||
212 | } | ||||
213 | } | ||||
214 | | ||||
215 | MouseArea { | ||||
216 | anchors.fill: parent | ||||
217 | acceptedButtons: Qt.MiddleButton | ||||
218 | onClicked: Muted = !Muted | ||||
219 | } | ||||
225 | } | 220 | } | ||
226 | } | 221 | } |