Bug 417953 - Cannot drag and drop links into plasma-notes widget
Summary: Cannot drag and drop links into plasma-notes widget
Status: RESOLVED FIXED
Alias: None
Product: kdeplasma-addons
Classification: Plasma
Component: notes (show other bugs)
Version: 5.18.1
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2020-02-20 21:15 UTC by luca
Modified: 2020-02-26 18:17 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.18.3


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description luca 2020-02-20 21:15:54 UTC
SUMMARY
I was able to drag and drop links from the browser with plasma 5.14.5. 
Plasma.notes recognized them.

Now, after latest updates, I cannot drop links in the textarea.

STEPS TO REPRODUCE
1. drag and drop a link from the browser in the textarea

OBSERVED RESULT
a new icon or plasmoid is created on the desktop

EXPECTED RESULT
a link should be created in the textarea(in blue color and underlined).

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:
KDE Plasma Version: 5.17.5
KDE Frameworks Version: 5.62.0
Qt Version: 5.12.5

ADDITIONAL INFORMATION

Tested also in kde Neon unstable with Plasma version 5.18.80 with same behaviour.
Replacing plasmoids/org.kde.plasma.notes/contents/ui/main.qml with 5.14.5 version works.
Comment 1 Nate Graham 2020-02-21 06:04:52 UTC
Can confirm with Firefox and Chromium.
Comment 2 luca 2020-02-21 18:24:29 UTC
I'm absolutely not an expert in qml, but in this (perfectible) way it seems to work:

------------------------------------------------------------------------------

*** main.qml            2020-02-21 10:17:26.376005566 +0100
--- main.qml.modified   2020-02-21 19:07:32.898012627 +0100
***************
*** 146,151 ****
--- 146,152 ----
          }
  
          QQC2.ScrollView {
+             id: scrollview
              anchors {
                  top: parent.top
                  left: parent.left
***************
*** 308,317 ****
  
          DragDrop.DropArea {
              id: dropArea
!             anchors.fill: mainTextArea
  
              function positionOfDrop(event) {
!                 return mainTextArea.positionAt(event.x, event.y + mainTextArea.flickableItem.contentY)
              }
  
              onDrop: {
--- 309,318 ----
  
          DragDrop.DropArea {
              id: dropArea
!             anchors.fill: scrollview
  
              function positionOfDrop(event) {
!                 return mainTextArea.positionAt(event.x, event.y)
              }
  
              onDrop: {
------------------------------------------------------------------------------
Comment 3 luca 2020-02-22 12:55:36 UTC
in this way I've restored cursor shape changes:
----------------------------------------------------------------------------
***************
*** 337,342 ****
--- 338,349 ----
                  mainTextArea.deselect()
              }
              onDragEnter: mainTextArea.forceActiveFocus()
+ 
+           MouseArea {
+               anchors.fill: parent
+               cursorShape: mainTextArea.hoveredLink ? Qt.PointingHandCursor : Qt.IBeamCursor
+               acceptedButtons: Qt.NoButton
+          }
          }
  
          RowLayout {
---------------------------------------------------------------------------
Comment 4 Nate Graham 2020-02-23 17:42:46 UTC
Nice. Would you be interested in submitting a patch? That's the best way to get devs to review your code. Instructions are located at https://community.kde.org/Infrastructure/Phabricator

I can help if you need a hand with anything.
Comment 5 luca 2020-02-23 20:34:20 UTC
thanks for the trust, but i think i did enough.
I have reported the bug and indicated where to act.

Best, Luca.
Comment 6 luca 2020-02-25 14:37:54 UTC
I sent a pull request on github
Best, Luca.
Comment 7 Nate Graham 2020-02-25 14:43:17 UTC
What's the URL? We use GitHub as a mirror, btu development activity happens on https://phabricator.kde.org/ instead. I can help walk you through the process if you need a hand.
Comment 8 luca 2020-02-25 14:59:24 UTC
I had an old account on github ;)

https://github.com/KDE/kdeplasma-addons/pull/6

I'll take a look at https://phabricator.kde.org/

Best.
Comment 9 Nate Graham 2020-02-26 18:17:52 UTC
Git commit b03539a0d8d3b9e5a7c580c926c618bde0dbe374 by Nate Graham, on behalf of Luca Pedrielli.
Committed on 26/02/2020 at 18:16.
Pushed by ngraham into branch 'Plasma/5.18'.

[applets/notes] Fix drag&drop links and cursor shape regression

Summary:
Restore the possibility to drag and drop the links from browser, and the cursor shape now changes on links.
FIXED-IN: 5.18.3

Reviewers: #plasma, ngraham

Reviewed By: ngraham

Subscribers: ngraham

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D27673

M  +9    -2    applets/notes/package/contents/ui/main.qml

https://commits.kde.org/kdeplasma-addons/b03539a0d8d3b9e5a7c580c926c618bde0dbe374