Notes from "Async and representation"

Mark Gaiser markg85 at gmail.com
Tue Jan 14 23:01:35 UTC 2014


On Tue, Jan 14, 2014 at 8:14 PM, Marco Martin <notmart at gmail.com> wrote:
> Hi all,
> those are some notes in a probable API change that will probably happen (let's
> discuss!) on how QML plasmoids are written.
>
> The problem:
> * plasmoids needs some properties in the root object, such as minimumWidth,
> maximumWidth, compactRepresentation..
> * the user has to declare *and* implement them: completely magic, the bad
> magic
> * we want async loading as much as possible: ifwe are in a popup, the "main"
> applet area should be loaded only when the popup opens. this is right now
> possible but has to be made quite explicitly with the ConditionalLoader
> component
>
> The proposal:
> * force plasmoids implementations to implement a new component, called Applet
> or something like that
> * this component is a simple QObject, so it can't contain any UI
> * it exports explicitly the properties we need: minimumWidth/height other
> sizes, compactRepresentation..
> * and a new component: fullRepresentation: it will contain the stuff that are
> intended to go in the full applet, so the popup contents or the full view in
> the desktop.
> * both compact and full representation are created on demand when needed, so
> are *not* guaranteed to always exist.
> * everything that needs to always exist is stuff like model and dataengines
> (therefore not graphical) this will have to be child of the root Applet item.
> (another proposal was to make another property that contains it)
> * another thing i was thinking about is that some AppletInterface
> functionalities can be moved there (can be "plasmoid" the root object? i am
> not sure how much technically feasible, it may be experimented tough)
>
>
> Pros:
> * allows experiments: one day we may have a "mediacenterrepresentation" and so
> on
> * neat api
>
> Cons:
> * may not make fully sense in containments: compactRepresentation is
> meaningless here
> * will break *all* plasmoids, will be necessary to adapt everything, how much
> will delay?
>
> a draft of the Appelt api can be found in the branch mart/AppletComponent in
> plasma-framework
>
> Cheers,
> Marco Martin
> _______________________________________________
> Plasma-devel mailing list
> Plasma-devel at kde.org
> https://mail.kde.org/mailman/listinfo/plasma-devel

Hi Marco,

So if i get it right you propose that every plasmoid - in QML - will
at the very least have this:

Item {

  Applet {
    minimumWidth: ...
    minimumHeight: ...
    ...
  }
}

right?

If that's the case then i'd like to suggest to figure out how to do
that in the root object which will make it look as follows:

Item {

  minimumWidth: ...
  minimumHeight: ...
  ...
}

That seems cleaner to me. Specially because Applet doesn't seem to do
much or anything else. Just a container of some "must be provided"
properties. I know you can inspect QML from the C++ code and figure
out if a property is set. How, i don't know :)

Why are there minimal requirements anyway? Won't a plain simple QML file like:
Item {
  width: 100
  height: 100
}

Would the above stop to work when loaded through plasma? If so it
would seem very odd to me. If those "must be provided" properties are
not set then just threat it as a desktop plasmoid.

Cheers,
Mark


More information about the Plasma-devel mailing list