From ae658c33c8a68067da9a583135cf60fa07a6556a Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Fri, 4 Nov 2016 15:23:44 +0100 Subject: [PATCH] fix behavior of scrollable systray popups Summary: it's very rare that the icon list in the hidden area of the systray is long enough to get a scrollbar, but when it does it had a couple of issues: sometimes it gets an horizontal scrollbar too and the wheel events gets eaten: always disable the horizontal scrollbar and ignore wheel events over the label. wheel events over the icon are still managed by the applet (so still possible to for instance adjusting the volume on pa applet) BUG:372050 Test Plan: hidden all the cions to enable scrollbar: wheel over the text scrolls the view, over the icon adjusts the volume Reviewers: #plasma, davidedmundson Reviewed By: #plasma, davidedmundson Subscribers: davidedmundson, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D3263 --- applets/systemtray/package/contents/ui/HiddenItemsView.qml | 1 + .../systemtray/package/contents/ui/items/AbstractItem.qml | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/applets/systemtray/package/contents/ui/HiddenItemsView.qml b/applets/systemtray/package/contents/ui/HiddenItemsView.qml index 3793aac8f..ea1f386c5 100644 --- a/applets/systemtray/package/contents/ui/HiddenItemsView.qml +++ b/applets/systemtray/package/contents/ui/HiddenItemsView.qml @@ -32,6 +32,7 @@ PlasmaExtras.ScrollArea { property alias layout: hiddenTasksColumn //Useful to align stuff to the column of icons, both in expanded and shrink modes property int iconColumnWidth: root.hiddenItemSize + highlight.marginHints.left + highlight.marginHints.right + horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff verticalScrollBarPolicy: activeApplet ? Qt.ScrollBarAlwaysOff : Qt.ScrollBarAsNeeded Flickable { diff --git a/applets/systemtray/package/contents/ui/items/AbstractItem.qml b/applets/systemtray/package/contents/ui/items/AbstractItem.qml index 429661418..5e337ad39 100644 --- a/applets/systemtray/package/contents/ui/items/AbstractItem.qml +++ b/applets/systemtray/package/contents/ui/items/AbstractItem.qml @@ -102,7 +102,12 @@ PlasmaCore.ToolTipArea { abstractItem.hideToolTip() abstractItem.clicked(mouse) } - onWheel: abstractItem.wheel(wheel) + onWheel: { + abstractItem.wheel(wheel); + //Don't accept the event in order to make the scrolling by mouse wheel working + //for the parent scrollview this icon is in. + wheel.accepted = false; + } } PlasmaComponents.Label {