Milkytracker import fine tune
What i want to talk about here, is the size hints that those layout provide.Īs the Plasmoid object that I wrote about before, is now available another attached object called Layout, and is documented here. This makes construction of plasmoids and containments way easier. Those are similar to the good ol’QWidget layouts, we have linear (row and column) and grid layouts. Since Qt 5.1, QML2 has a new set of components: the Layouts. Making your plasmoid to behave well in a layout
Put all of the UI under Plasmoid.fullRepresentation.Use the default icon as compact representation when possible (to have that just don’t define any compactRepresentation, it will take the default).Write a root Item as simple and lightweight as possible.Therefore, in Plasma Next, the recomended way to write a QML plasmoid is:
#MILKYTRACKER IMPORT FINE TUNE CODE#
Plasmoid.fullRepresentation will probably usually contain the most complicated code since it may be abig and complex UI, but when it’s in the panel it won’t get created until the user opens it, so it won’t cut on precious startup time. rest of your plasmoid code, only data model related items, there won't be any graphics object here anymore Plasmoid.title: "My custom plasmoid title" Import 2.0 //needed to give the Plasmoid attached properties
#MILKYTRACKER IMPORT FINE TUNE FULL#
In Plasma Next, besides the global plasmoid object, accessible from anywhere (any item and any qml file in the plasmoid), we have also an attached object, called “Plasmoid” (uppercase) that provides the full plasmoid api (is the same object, really) as QML attached properties of the root Item of your plasmoid, so you can have a very, very convenient way to read and write properties, and to do signal handlers. Wait, what are “The compact and the full representations”? to find out, skip to the next paragraph ?
In QML1 plasmoids, you had a global object accessible from everywhere in the plasmoids called with much imagination, “plasmoid”
This article is pretty long (sorry no pretty pictures this time ), and is probably easy to just TR DL it, but it will give some important guidelines if you will ever interested to write a plasmoid for Plasma Next, such as “how the hell can I make my plasmoid have a correct size in the panel.”įirst of all I’ll start with a short personal note: I just started with a new position in Blue Systems, where I’ll work towards making the next iteration of the Plasma technologies, both as a framework and as a desktop ready for prime time, aiming to give the best experience possible on the all new Qt5, Frameworks5 based Plasma Desktop by KDE. For the next iteration of Plasma, we are not only revising the user experience, but also making better the developer story.