Oct
16
2007

Since it appears that the last explanation (which I recommend you to read before opening the example sheet) of NodeLayout was not as good as it should be, here you are – drawn explanation with a few examples in .png format (33K).
Unfortunately WordPress doesn’t allow me to upload the svgz file… hope you’ll be able to read the small text in the picture.
Oct
13
2007
Yes, it’s that time of year again – the time for backporting layouts from Lancelot to Plasma.
NodeLayout is one of the most powerful layouts in general, in a sense of that it’s expressiveness for positioning static content is greater than any current layout in Plasma.
The idea behind it is to help developers avoid creating multiple different layout objects mixed and nested in each other when creating complex UIs. It’s a bit trickier to get the hang of it – the nodes definition, but once you get to know it, it will become your natural way of thinking.
(yes, I know I’m sounding like a shampoo commercial)
Every item’s geometry is defined by two nodes – one for the top-left corner, and the other one for the bottom-right corner.
Each node is defined by a pair of relative (xr, yr) and a pair of absolute (xa, ya) coordinates. The calculated node coordinates depend
on the size and position of the NodeLayout object in the following manner (layout is the geometry of the NodeLayout):
- x = layout.left() + (xr * layout.width()) + xa
- y = layout.top() + (yr * layout.height()) + ya
Alternatively, the item’s position can be defined by using one node and one pair of relative coordinates (xr, yr). In that case, the item is sized following the sizeHint(). The relative coordinates (this time they are relative to the item’s geometry, not the layout’s) specify what point of the item will be bound to the defined node.
Note: The horizontal and vertical values are completely independent so you can, for example, have automatic (sizeHint defined) sizing for width, and fixed sizing for height.
Sep
19
2007
While waiting for Aaron (it’s hard to write his name properly instead of AAron, isn’t it?) to give me the instructions for merging the Applet Browser into the libplasma, I had to do something interesting to keep me warm.
The first thing is that the FileBrowser engine is moved from playground to the plasma‘s trunk. If you don’t remember, the engine gives you the ability to monitor files and directories for changes, to retrieve file meta data etc. and all of that from inside the Plasma applets.
The second thing is a new Plasma layout named BorderLayout. It is inspired by the Java’s java.awt.BorderLayout. I needed something like this for my not-yet-to-be-revealed-launcher Lancelot. It can contain up to 5 items – one for each border (left, top, right, bottom) and one for the center. Since it is easier to show it, than to describe the actual layout, here it is:
| Top |
| Left |
Center |
Right |
| Bottom |
The sizes of the borders (width for left and right, and height for top and bottom) can be calculated using the sizeHint of the items (default), or can be user-specified (developer-specified).
And, finally, the last thing that is not in the SVN yet is the KioBrowser engine, which retreives list of ‘files’ at a specific KIO location (for example applications:/, system:/)
p.s. The OpenID+ plug-in has some fatal error while activating, and I don’t have the time to fix that – so no openID identification on this blog yet…