Commit f2489261 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 60df122e
Pipeline #247832 passed with stage
in 1 minute and 56 seconds
......@@ -5,7 +5,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 org.kde.kirigami 2.4 as Kirigami
......@@ -83,6 +83,15 @@ 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 {
......@@ -90,6 +99,8 @@ Item {
margins: outline.border.width
}
// so the text is drawn above orientationPanelContainer
z: 1
ColumnLayout {
anchors.centerIn: parent
spacing: 0
......@@ -242,6 +253,7 @@ Item {
TapHandler {
id: tapHandler
property bool isLongPressed: false
gesturePolicy: TapHandler.WithinBounds
function bindSelectedOutput() {
root.selectedOutput
......@@ -262,6 +274,7 @@ Item {
id: dragHandler
enabled: kcm.outputModel && kcm.outputModel.rowCount() > 1
acceptedButtons: Qt.LeftButton
grabPermissions: PointerHandler.CanTakeOverFromAnything | PointerHandler.TakeOverForbidden
target: null
onTranslationChanged: {
......@@ -275,13 +288,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