plasma-desktop rebuild

This commit is contained in:
Rmys
2021-10-18 21:32:06 +03:00
committed by GitHub
parent 0d39520dd5
commit 55992cd9b9
2 changed files with 108 additions and 1 deletions
@@ -0,0 +1,100 @@
From ac9ef2b66d4be08cbf6a1702ee92641b80e50974 Mon Sep 17 00:00:00 2001
From: Noah Davis <noahadvs@gmail.com>
Date: Sun, 17 Oct 2021 05:50:26 -0400
Subject: [PATCH] kickoff: Replace Kicker DragHelper with Qt Quick Drag
Originally, I thought it wasn't possible to use Qt Quick Drag here, but
then I found out I could use Item::grabToImage()'s function callback
parameter to set Drag.imageSource.
BUG: 443708
---
.../contents/ui/KickoffItemDelegate.qml | 25 +++++++------------
.../package/contents/ui/KickoffSingleton.qml | 11 --------
2 files changed, 9 insertions(+), 27 deletions(-)
diff --git a/applets/kickoff/package/contents/ui/KickoffItemDelegate.qml b/applets/kickoff/package/contents/ui/KickoffItemDelegate.qml
index bb2bc1185..c77b07111 100644
--- a/applets/kickoff/package/contents/ui/KickoffItemDelegate.qml
+++ b/applets/kickoff/package/contents/ui/KickoffItemDelegate.qml
@@ -179,6 +179,10 @@ T.ItemDelegate {
maximumLineCount: 1
}
+ Drag.active: mouseArea.drag.active
+ Drag.dragType: Drag.Automatic
+ Drag.mimeData: { "text/uri-list" : root.url }
+
MouseArea {
id: mouseArea
parent: root
@@ -201,16 +205,6 @@ T.ItemDelegate {
minimumY: 0
maximumY: root.view ? Math.min(root.view.contentHeight - root.height, root.view.availableHeight - root.height) : root.y
}
- Binding {
- target: KickoffSingleton; when: root.dragActive
- property: "dragSource"; value: root
- restoreMode: Binding.RestoreBindingOrValue
- }
- Binding {
- target: KickoffSingleton.dragHelper; when: root.dragActive
- property: "dragIconSize"; value: root.icon.height
- restoreMode: Binding.RestoreBindingOrValue
- }
// Using onPositionChanged instead of onEntered to prevent changing
// categories while scrolling with the mouse wheel.
onPositionChanged: {
@@ -223,6 +217,11 @@ T.ItemDelegate {
// built into QQuickListView::setCurrentIndex() already
root.view.currentIndex = index
}
+ onPressed: if (root.dragEnabled && root.Drag.imageSource == "") {
+ iconItem.grabToImage((result) => {
+ return root.Drag.imageSource = result.url
+ })
+ }
onClicked: if (mouse.button === Qt.LeftButton) {
root.forceActiveFocus(Qt.MouseFocusReason)
root.action.trigger() // clicked() is emmitted when action is triggered
@@ -277,15 +276,9 @@ T.ItemDelegate {
indicator = null
}
}
-
- // NOTE: Not using Drag attached properties because we're using DragHelper instead.
- // Drag doesn't support QIcons for the imageSource, only URLs.
onDragActiveChanged: if (dragActive) {
dragStartPosition = Qt.point(x,y)
dragStartIndex = index
- // Fixes warning: "Passing incompatible arguments to C++ functions from JavaScript is dangerous and deprecated."
- //const url = root.url ? root.url : ""
- KickoffSingleton.dragHelper.startDrag(root, url, decoration)
} else if (dragStartIndex === index) {
x = dragStartPosition.x
y = dragStartPosition.y
diff --git a/applets/kickoff/package/contents/ui/KickoffSingleton.qml b/applets/kickoff/package/contents/ui/KickoffSingleton.qml
index 3e1ff50db..d77e40bf5 100644
--- a/applets/kickoff/package/contents/ui/KickoffSingleton.qml
+++ b/applets/kickoff/package/contents/ui/KickoffSingleton.qml
@@ -45,17 +45,6 @@ Item {
}
//END
- //BEGIN Drag and Drop elements
- property Item dragSource: null
- // We have to use DragHelper here because the models use QIcons for the decoration role.
- // DragHelper supports QIcons and Drag.imageSource only supports urls.
- readonly property Kicker.DragHelper dragHelper: Kicker.DragHelper {
- id: dragHelper
- dragIconSize: PlasmaCore.Units.iconSizes.medium
- onDropped: dragSource = null
- }
- //END
-
//BEGIN UI elements
// Set in FullRepresentation.qml
property Item header: null
--
GitLab
+8 -1
View File
@@ -95,7 +95,7 @@
<Dependency>libXcursor-devel</Dependency>
</BuildDependencies>
<Patches>
<!-- <Patch level="1">plasma-desktop-animation-duration.patch</Patch> -->
<Patch level="1">ac9ef2b6.patch</Patch>
</Patches>
</Source>
@@ -194,6 +194,13 @@
</Package>
<History>
<Update release="53">
<Date>2021-10-18</Date>
<Version>5.23.0</Version>
<Comment>Rebuild.</Comment>
<Name>Mustafa Cinasal</Name>
<Email>muscnsl@gmail.com</Email>
</Update>
<Update release="52">
<Date>2021-10-14</Date>
<Version>5.23.0</Version>