From 890e91b29bfea52c10b13c055d4328528e9690f1 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Fri, 22 Mar 2019 18:28:28 +0100 Subject: [PATCH] systray: show a the context menu upon press an hold on the icon Summary: This way we can open the context menu from touch Test Plan: Tapped and hold on my screen Reviewers: #plasma, ngraham Reviewed By: ngraham Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D19946 --- applets/systemtray/package/contents/ui/items/AbstractItem.qml | 3 +++ .../package/contents/ui/items/StatusNotifierItem.qml | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/applets/systemtray/package/contents/ui/items/AbstractItem.qml b/applets/systemtray/package/contents/ui/items/AbstractItem.qml index 17758bd53..7489bc20a 100644 --- a/applets/systemtray/package/contents/ui/items/AbstractItem.qml +++ b/applets/systemtray/package/contents/ui/items/AbstractItem.qml @@ -112,6 +112,9 @@ PlasmaCore.ToolTipArea { abstractItem.contextMenu(mouse) } } + onPressAndHold: { + abstractItem.contextMenu(mouse) + } onWheel: { abstractItem.wheel(wheel); //Don't accept the event in order to make the scrolling by mouse wheel working diff --git a/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml b/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml index 65ad25563..bf9261b21 100644 --- a/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml +++ b/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml @@ -59,6 +59,10 @@ AbstractItem { } } + onContextMenu: { + openContextMenu(plasmoid.nativeInterface.popupPosition(taskIcon, mouse.x, mouse.y)) + } + onClicked: { var pos = plasmoid.nativeInterface.popupPosition(taskIcon, mouse.x, mouse.y);