Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/ListItemBase.qml
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Line(s) | 101 | PlasmaExtras.Heading { | |||
---|---|---|---|---|---|
107 | elide: Text.ElideRight | 107 | elide: Text.ElideRight | ||
108 | } | 108 | } | ||
109 | PlasmaComponents.ToolButton { | 109 | PlasmaComponents.ToolButton { | ||
110 | id: contextMenuButton | 110 | id: contextMenuButton | ||
111 | Layout.preferredHeight: slider.height | 111 | Layout.preferredHeight: slider.height | ||
112 | Layout.preferredWidth: Layout.preferredHeight | 112 | Layout.preferredWidth: Layout.preferredHeight | ||
113 | checkable: true | 113 | checkable: true | ||
114 | iconName: "application-menu" | 114 | iconName: "application-menu" | ||
115 | onClicked: contextMenu.show(x, y + height) | 115 | onClicked: contextMenu.show() | ||
116 | } | 116 | } | ||
117 | } | 117 | } | ||
118 | 118 | | |||
119 | RowLayout { | 119 | RowLayout { | ||
120 | PlasmaCore.IconItem { | 120 | PlasmaCore.IconItem { | ||
121 | readonly property bool isPlayback: type.substring(0, 4) == "sink" | 121 | readonly property bool isPlayback: type.substring(0, 4) == "sink" | ||
122 | roundToIconSize: false | 122 | roundToIconSize: false | ||
123 | Layout.preferredWidth: Math.round(slider.height * 0.95) | 123 | Layout.preferredWidth: Math.round(slider.height * 0.95) | ||
▲ Show 20 Lines • Show All 106 Lines • ▼ Show 20 Line(s) | 228 | MouseArea { | |||
230 | acceptedButtons: Qt.MiddleButton | 230 | acceptedButtons: Qt.MiddleButton | ||
231 | onClicked: Muted = !Muted | 231 | onClicked: Muted = !Muted | ||
232 | } | 232 | } | ||
233 | } | 233 | } | ||
234 | 234 | | |||
235 | PlasmaComponents.ContextMenu { | 235 | PlasmaComponents.ContextMenu { | ||
236 | id: contextMenu | 236 | id: contextMenu | ||
237 | 237 | | |||
238 | visualParent: contextMenuButton | ||||
239 | placement: PlasmaCore.Types.BottomPosedLeftAlignedPopup | ||||
240 | | ||||
238 | onStatusChanged: { | 241 | onStatusChanged: { | ||
239 | if (status == PlasmaComponents.DialogStatus.Closed) { | 242 | if (status == PlasmaComponents.DialogStatus.Closed) { | ||
240 | contextMenuButton.checked = false; | 243 | contextMenuButton.checked = false; | ||
241 | } | 244 | } | ||
242 | } | 245 | } | ||
243 | 246 | | |||
244 | function newSeperator() { | 247 | function newSeperator() { | ||
245 | return Qt.createQmlObject("import org.kde.plasma.components 2.0 as PlasmaComponents; PlasmaComponents.MenuItem { separator: true }", contextMenu); | 248 | return Qt.createQmlObject("import org.kde.plasma.components 2.0 as PlasmaComponents; PlasmaComponents.MenuItem { separator: true }", contextMenu); | ||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | 296 | var setActivePort = function(portIndex) { | |||
296 | }; | 299 | }; | ||
297 | }; | 300 | }; | ||
298 | menuItem.clicked.connect(setActivePort(i)); | 301 | menuItem.clicked.connect(setActivePort(i)); | ||
299 | contextMenu.addMenuItem(menuItem); | 302 | contextMenu.addMenuItem(menuItem); | ||
300 | } | 303 | } | ||
301 | } | 304 | } | ||
302 | } | 305 | } | ||
303 | 306 | | |||
304 | function show(x, y) { | 307 | function show() { | ||
305 | loadDynamicActions(); | 308 | loadDynamicActions(); | ||
306 | open(x, y); | 309 | openRelative(); | ||
307 | } | 310 | } | ||
308 | } | 311 | } | ||
309 | } | 312 | } |