Commit f9d691d9 authored by Marco Martin's avatar Marco Martin
Browse files

Make the Output component accept events

This is a workaround to the "drag from empty areas" hack in breeze.
since this uses Event Handlers to manage the drag, the withinBounds property will make it accept the events
also use grabPerimissions to stop anything else from managing the events

BUG: 460280
FIXED-IN: 5.26.1
parent 8aa2d95f
Pipeline #247839 passed with stage
in 2 minutes and 50 seconds
......@@ -4,7 +4,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
import QtQuick 2.12
import QtQuick 2.15
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.3 as Controls
import QtGraphicalEffects 1.0
......@@ -62,6 +62,20 @@ Item {
Item {
anchors.fill: parent
// So we can show a grabby hand cursor when hovered over
HoverHandler {
cursorShape: kcm.outputModel && kcm.outputModel.rowCount() > 1 ? Qt.SizeAllCursor : undefined
}
z: 2
}
Item {
id: labelContainer
anchors {
fill: parent
margins: outline.border.width
}
// so the text is drawn above orientationPanelContainer
z: 1
ColumnLayout {
......@@ -231,6 +245,7 @@ Item {
TapHandler {
id: tapHandler
property bool isLongPressed: false
gesturePolicy: TapHandler.WithinBounds
function bindSelectedOutput() {
root.selectedOutput
......@@ -251,6 +266,7 @@ Item {
id: dragHandler
enabled: kcm.outputModel && kcm.outputModel.rowCount() > 1
acceptedButtons: Qt.LeftButton
grabPermissions: PointerHandler.CanTakeOverFromAnything | PointerHandler.TakeOverForbidden
target: null
onTranslationChanged: {
......@@ -264,13 +280,5 @@ Item {
}
}
}
// So we can show a grabby hand cursor when hovered over
MouseArea {
anchors.fill: parent
cursorShape: Qt.SizeAllCursor
acceptedButtons: Qt.NoButton // Otherwise it interferes with the drag handler
visible: kcm.outputModel && kcm.outputModel.rowCount() > 1
}
}
......@@ -19,6 +19,9 @@ KCM.SimpleKCM {
property int selectedOutput: 0
property int revertCountdown: 15
// This is to fix Output dragging
flickable.interactive: Kirigami.Settings.hasTransientTouchInput
ColumnLayout {
Kirigami.InlineMessage {
// Note1: There is an implicit height binding loop error on
......
Supports Markdown
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