Applet component, current status

Marco Martin notmart at gmail.com
Wed Jan 22 12:55:41 UTC 2014


Hi all,
I have a now basic working Applet (and Containment) component on the branch 
mart/AppletComponent of plasma-framework

to test it, it needs a branch of the same name in kde-workspace and plasmate.

since there is exactly one applet (compactrepresentation in examples) and one 
containment (desktop) ported to it, it works only in plasmoidviewer for now.

plasmoidviewer -a org.kde.example.compactrepresentation

the code is still quite rough, since appletinterface and containment interface 
(that are now qml imports) still contain a ton of cruft that should be washed 
out.

the components are applet and Containment, right now in the org.kde.shell 
import. (needed a separate one since it still lives in the scriptengine .so, 
it may be transferred to plasmacore in the future)

I would like to ask people to try it and find eventual issues, since i'm still 
not convinced by it. issues may be.

* significant regressions compared to current master?
* how hard is to port all plasmoids? can it cause unwanted delays in the 
release?
* how this affects the systray? makes its implementation harder or easier? (+: 
no more duplicate appletInterface, -: a pointer to an applet() is needed and 
may be necessary to implement systray specific workarounds in the component 
itself)
* are people comfortable with the api on plasmoid side?


Main things i don't like are:
* The applet component is completely meaningless if used in any other context 
than the root object of a plasmoid

* For a containment, you'll have to explicitly use the Containment object 
instead of Applet: using an Applet will work, but no containment specific api 
will be accessible (and no plasmoid in the containment visible). while using 
Containment when is a normal applet, it will work (and it should,since 
containment may be applets) but all the containment specific api witll be just 
dead and not working

* declaration of containments is really odd, that's the new main.qml of the 
desktop containment:

import QtQuick 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.shell 2.0

Containment {
    id: root

    fullRepresentation: FullRepresentation {}
}

while FullRepresentation.qml is the old main.qml .. this kindof screams of 
boilerplate ;)




All in all, even if i'm not sure this branch is the definite way to go, there 
are some things that i'm quite sure are:
* use the Layout attached property for size hints in applets: it's an "official" 
api for it so familiar to 3rd party qml developers and easy to propagate from 
RowLayouts, gridLayouts etc, getting rid of minimumWidth etc properties

* propagate the Layout sizehints to the plasmacore.Dialog's QWindow 
minimum/maximum sizes (still not done, will enhance behavior of stuff 
dramatically)

* have the size in which we switch representation independent from it, like 
switchWidth/switchHeight, if not specified, keep a fixed representation based on 
formfactors (full on desktops, iconified on panels)


Cheers,
Marco Martin


More information about the Plasma-devel mailing list