From 8de1f923a4564d898ca807660f8b81aa273d322b Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 1 Feb 2022 11:54:43 +0100 Subject: [PATCH] Fix clicking, and don't allow dragging if not needed When I changed the MouseArea into a TooltipArea, the clicking broke because the tooltip area doesn't catch mouse events. I could add another mouse area on top, but for better efficiency it's nice to re-use the TooltipArea. Just need to remember to allow clicking it. I also found a small issue where you could flick the table even if it's not big enough to scroll. This should fix that. Contributes to issue CURA-8686. --- plugins/DigitalLibrary/resources/qml/Table.qml | 2 ++ resources/qml/TableView.qml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/plugins/DigitalLibrary/resources/qml/Table.qml b/plugins/DigitalLibrary/resources/qml/Table.qml index 2e4c89dfa1..b503bb8e2f 100644 --- a/plugins/DigitalLibrary/resources/qml/Table.qml +++ b/plugins/DigitalLibrary/resources/qml/Table.qml @@ -115,6 +115,7 @@ Item bottom: parent.bottom } + flickableDirection: Flickable.AutoFlickIfNeeded clip: true ScrollBar.vertical: ScrollBar { @@ -173,6 +174,7 @@ Item { anchors.fill: parent + acceptedButtons: Qt.LeftButton text: (cellTextMetrics.elidedText == cellContent.text) ? "" : cellContent.text //Show full text in tooltip if it was elided. onClicked: { diff --git a/resources/qml/TableView.qml b/resources/qml/TableView.qml index cd787a6fd6..1fedc34ca0 100644 --- a/resources/qml/TableView.qml +++ b/resources/qml/TableView.qml @@ -116,6 +116,7 @@ Item bottom: parent.bottom } + flickableDirection: Flickable.AutoFlickIfNeeded clip: true ScrollBar.vertical: UM.ScrollBar {} columnWidthProvider: function(column) @@ -152,6 +153,7 @@ Item { anchors.fill: parent + acceptedButtons: Qt.LeftButton text: (cellTextMetrics.elidedText == cellContent.text) ? "" : cellContent.text //Show full text in tooltip if it was elided. onClicked: {