Cqoicebordel / webslice-plasmoid

Add a slice of web on your desktop. https://www.pling.com/p/998902/
http://www.cqoicebordel.net/webslice-plasmoid/
GNU Affero General Public License v3.0
31 stars 12 forks source link

Context menu with icons #3

Closed kotelnik closed 9 years ago

kotelnik commented 9 years ago

Hi! I managed to make your menu working. Grab it if you like :)

And thanks for this nice applet!

kotelnik commented 9 years ago

Note: this is my first pull request, sorry if I've done something wrong...

Cqoicebordel commented 9 years ago

Whoa ! Awesome ! And it's beautiful !

Thanks a lot !!!

Cqoicebordel commented 9 years ago

And don't worry, your pull request was exactly as it was supposed to be :) If I wanted to be picky, I could say that a better description is always welcome, but I would be afraid to scare you away ;)

Don't hesitate to commit other things ! :)

Cqoicebordel commented 9 years ago

Can I ask you where did you find the docs for that ? I seem to only be able to find popup() :/ As I'm far from knowledgable on the plasmoids, I think I looked only in the wrong places...

kotelnik commented 9 years ago

Sure. I couldn't find much like you. I started here: http://api.kde.org/frameworks-api/frameworks5-apidocs/plasma-framework/html/index.html where I checked Plasma Core, Plasma Components and Plasma Extra Components to find plasma specific menu/contextMenu - found it under Plasma Components link. But of course when you click on some of the menu links (Menu, MenuItem, ContextMenu) there is no documentation...

When that happens I go here: /usr/share/plasma/plasmoids and by fulltext-search I found number of files containing string "PlasmaComponents.ContextMenu" including this file: /usr/share/plasma/plasmoids/org.kde.plasma.kickoff/contents/ui/configGeneral.qml - which is particularly useful in your case.

These plasma-built-in widgets are for me probably the best source of knowledge about QML widget coding... And of course a very good place to look is this wiki: https://techbase.kde.org/Development/Tutorials/Plasma2/QML2/API but you probably know this page...

To answer to previous: thanks for advice, I'll be more descriptive next time :)

Cqoicebordel commented 9 years ago

Yep I knew the first and last link, but they are so aweful, and full of dead ends :/

Thanks for the idea of looking at it locally !

Anyway, thanks a lot again :)

Cqoicebordel commented 9 years ago

Just so you know, because it could be helpful to you too, the 'mouse.x, mouse.y) positionning wasn't good, because it took the whole page as reference, and so, when the page was scrolled, the popup was way off. The solution was hard to find, so I let you see the diff directly : https://github.com/Cqoicebordel/webslice-plasmoid/commit/8d30e86524362f1031917420a11c7433f9371bcf#diff-6a978cadff66761796abb790b0bd62eaR79

kotelnik commented 9 years ago

Thanks for sharing that! I can see I didn't test my solution very well. This will be very helpful when I'll have to deal with mouse events. :)