PopupApplet with Qml/JS broken?
Diego Casella ([Po]lentino)
polentino911 at gmail.com
Tue Apr 19 16:09:52 CEST 2011
Hey guys,
sorry for bothering you again, but I'm still stuck with making the
popupApplet plasmoid work with qml bindings. Since inside qml world wasn't
working at all, I've tried to move one step back, and made a simple plasmoid
in pure JS to test the popupApplet correctness; below, here it is what I've
found.
First, according to [0], popupIcon is declared as:
Q_PROPERTY(QIcon popupIcon READ popupIcon WRITE setPopupIcon)
Fair enough. Therefore, my first test plasmoid was:
mainLayout = new LinearLayout(plasmoid);
label = new Label();
label.text = '<font color=\'red\'>Hello JavaScript!!</font>';
mainLayout.addItem(label);
plasmoid.setMinimumSize(100,100);
plasmoid.popupWidget = label;
plasmoid.setPopupIcon(new QIcon("plasma"));
Result: plasmate & plasmoidviewer crashes every time :\
I've replaced the last line with
plasmoid.popupIcon = new QIcon("plasma");
And now I can see the label correctly placed inside the plasmoid. But, when
I placed it inside a panel and reduce the panel size, the plasmoid instead
of collapsing to an icon, appeared on the top left corner of the screen ..
At this point (I didn't mentioned all the attempts I made), I tried the
advice was told me (even if popupIcon is a QIcon property) so I replaced,
again, the last line with:
plasmoid.popupIcon = "plasma";
And now I didn't see that label in the panel, so I was kind of "yay"!
But the "plasma" icon was still missing, and clicking the invisible plasmoid
popped out a crappy widget with that label inside. The strangest part was
when I moved the plasmoid from the panel to the desktop: even increasing the
plasmoid size, the label never came visible within it. So I tried to click
inside the plasmoid and, without any reason, the crappy popup with the
label appeared again.
I've attached a screenshot so you can see what happened, because it's really
weird: the popup is placed over the folderview plasmoid (I've set the text
color to 'red' to improve its visibility) and, when I tried to click that
popup, the standard menu (the usual plasma-desktop mouse-plugin) came out,
like there were no plasmoids under the mouse cursor at all :\
As a side note, plasmoid.popupEvent() is not working at all, plasma-dekstop
complains saying "Object::connect: No such signal
Plasma::PopupApplet::popupEvent(bool)" :(
Seems like popup applets are a bit broken with JS (and, by extension, qml),
or it's just me?
Any hints/suggestions (examples in kdeexample module ;) ?
Sorry for the long and a bit angry email, but it's kinda frustrating playing
with 5 lines of code for days and still get no results :(
Cheers,
Diego
[0]:
https://projects.kde.org/projects/kde/kdebase/kde-runtime/repository/revisions/master/entry/plasma/scriptengines/javascript/plasmoid/appletinterface.h
--
H: Who is Watson without Sherlock Holmes?
G: Watson was a genius in his own right.
My personal blog: http://polentino911.wordpress.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/plasma-devel/attachments/20110419/631e647e/attachment-0001.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wrong_popup.png
Type: image/png
Size: 179276 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20110419/631e647e/attachment-0001.png
More information about the Plasma-devel
mailing list