Commit f2a220c1 authored by David Redondo's avatar David Redondo 🏎
Browse files

Use handlers in sub category header

For some reason I could not figure out, tapping on the header using
touch did not trigger onClicked() of the mouse area (for reference
pressed was true though). Using Handlers makes it work.


(cherry picked from commit 689a70dd)
parent 0565ec5e
......@@ -4,7 +4,7 @@
SPDX-License-Identifier: LGPL-2.0-only
*/
import QtQuick 2.5
import QtQuick 2.15
import QtQuick.Controls 2.5 as QQC2
import QtQuick.Layouts 1.1
......@@ -38,24 +38,24 @@ Kirigami.ScrollablePage {
visible: false
}
background: Rectangle {
visible: !applicationWindow().wideScreen
background: Rectangle {
color: Kirigami.Theme.highlightColor
opacity: mousearea.containsMouse ? (mousearea.pressed ? 0.4 : 0.2) : 0
opacity: hoverHandler.hovered ? (tapHandler.pressed ? 0.4 : 0.2) : 0
visible: !applicationWindow().wideScreen
Accessible.role: Accessible.Button
Accessible.name: i18n("Go back")
TapHandler {
id: tapHandler
acceptedButtons: applicationWindow().wideScreen ? Qt.NoButton : Qt.LeftButton
onTapped: root.pageStack.currentIndex = 0;
}
HoverHandler {
id: hoverHandler
enabled: !Kirigami.Settings.isMobile
}
QQC2.ToolTip {
text: parent.Accessible.name
}
MouseArea {
id: mousearea
anchors.fill: parent
enabled: !applicationWindow().wideScreen
onClicked: root.pageStack.currentIndex = 0;
hoverEnabled: !Kirigami.Settings.isMobile
}
}
contentItem: RowLayout {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment