Signals and slots for containment show and hide actions (mainly for panels)

Aaron J. Seigo aseigo at kde.org
Tue Mar 31 17:55:07 CEST 2009


On Tuesday 31 March 2009, Emdek wrote:
> >> - in my Run Command plasmoid that uses KHistoryComboBox to make it
> >> work in panels (I've created report about problems with them and others
> >> on
> >> GraphicsView);
> >
> > this is working around a problem in QGraphicsScene/View, really; it will
> > get
> > fixed (it's being worked on) so there's no reason to hack around it
> > today.
> > there may even be other ways to do it nicely with the combo being
> > "manually"
> > shown as the popup for the applet, which would also keep the panel from
> > hiding.
>
> They are working on this bug? Finally, thanks for information. :-)

np...

> But I hoped that this will be fixed for Qt 4.5...

unfortunately we knew it wasn't going to be in 4.5; we're hoping for 4.5 
though.

> I'm not sure if Qt 4.6 will be released in this year, so it could be
> possible that users (including myself ;-)) would need to wait probably for
> KDE 4.5 in mid 2010. But what can I do now with this?

one thought i've had is to subclass it and provide a custom 
showPopup/hidePopup that takes the view() and positions is using 
Applet::popupPosition

still wouldn't get proper context menus on the line edit, but at least the 
combobox would work :)

> typical place to put this kind of applet). Small off topic, I'm interested
> in moving my applets to KDE SVN playground. I've already requested and get
> SVN account and I've stupid question, do I need do something before try to
> commit them there? ;-)

playground is open for anyone to put whatever they are working on in there. 
you don't need to ask anyone permission. the only real requirement is that 
stuff in playground/base/plasma is plasma related and builds. :)

> > again, compositing and input masks.
>
> Thanks, but I still don't know what to do. ;-)
> I think that there could be added page on techbase or somewhere with
> collections of this kind of tips and tricks (not only tutorials, these
> things are probably too small to make own tutorial for each). For example
> I've earlier working on media player applet and I couldn't find (and still
> don't know, after some months) how to make it play file when created by
> dropping supported MIME on desktop (I've found this part, how to add it to
> menu) but I couldn't find which API part (or maybe something else) must be
> added to make applet open that file on init.

look at the frame plasmoid perhaps. and maybe you could write a small tutorial 
on techbase with what you've found?

> > the tray tracks the location of the QGraphicsWidget and manually
> > positions the
> > items. this is fraught with problems, though, such as not being able to
> > be
> > visible in more than one view at a time, not working when zoomed out ...
> > same
> > kinds of problems any "manage a top level QWidget" approach will face
> > actually
> > (c.f. the "embed an application window" plasmoid)
>
> But sadly not everything could be done clean now, but for temporary
> solutions kinds of these hacks could be used, but not forever and only if
> it is not possible to do it better.

these kinds of hacks become permanent very easily. it's best to not let them 
in at all, and we certainly can't make changes to libplasma's public api for 
temporary hacks as that api must remain BC and hopefully clean.

> > maybe it should be two method? i just can't think of two good names for
> > it :)
> > anyone else?
>
> I've seen similar names in Tasks applet. ;-)
> requestVisualFocus(bool) seems to be good name for it.

ok, let's go for this then ...

> >> I've more suggestions about current status of keyboard
> >> shortcuts for applets, but these should be discussed separately. ;-)
> >
> > sure thing (and yes, there's more work to be done there, indeed!)
>
> Ok, so probably I'll start new thread later today, now I'm tired (when I
> was answering to your message it was 2 AM in my time zone, and yes, I'm
> saying to myself that I should go sleep earlier but this usually doesn't
> help when I'm working on something :-D).

i know the feeling :)

> there possibility to restrict (disallow placing or show warning) usage of
> applet to given type of containment / view?

no, and that's purposeful. the last thing we want are objects that only work 
in some places, because not only is that counter to the design goal of 
"widgets that work everywhere" but as a plasmoid author you have no idea what 
containment might appear next. it's a way of keeping the details of the 
outside world away from plasmoids so that they aren't full of odd work arounds 
and limitations.

> For example this "manual hiding
> plasmoid" would make sense only for "hideable" containments / views. But

sure, and that's up to the view to decide.

> maybe there is, or could be in future, way to query Plasma for existing
> containments of given type and offer to user list of them - when more than
> one - when for example on desktop.

and then when we introduce a different kind of view or containment, then all 
these plasmoids would probably break and/or do odd things.

> This could be used also for "quick
> unhide all panels" button for example.

again, this belongs in the view and in plasma-desktop.

> Anyway I'm still looking for way to
> achieve manual hiding, and I think that it should be don as flexible as
> possible (possibility to create plasmoid for this task gives very big
> possibilities), not as specific part of containment / view like these ugly
> buttons with arrows for hiding (I didn't like that they stay on screen
> after hiding but also know that it is for most of users easiest way to find
> way to show them again). So maybe this could be achieved by giving user
> possibility to decide (by options) what should containment / view do when
> hiding is requested - hide completely and unhide when requested by kind of
> signal or moving to edge like with autohide or show kind of indicator all
> the time when hidden (maybe constant glowing? rectangle buttons really

you've got some interesting ideas here that you should try experimenting with 
to see how they look and feel.

the plasmoid approach breaches the barrier between widget, containment and 
view so probably isn't workable, but what you describe here should be doable 
all within PanelView in workspace/plasma/shells/desktop/ ...

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20090331/7edaea6c/attachment.sig 


More information about the Plasma-devel mailing list