[Panel-devel] [PATCH] FreeLayout (layout for desktop-like areas)

Robert Knight robertknight at gmail.com
Sat Sep 8 16:15:42 CEST 2007


Hello,

Attached is an implementation of an idea to solve the applet resizing
confusion.  The idea is to make applets agnostic of whether they are
being used in a 'free' area like the desktop or a constrained area
such as the panel in a layout with other applets.

With this patch, the applet just needs to call updateGeometry() when
anything changes which affects its preferred size and it will be
resized and updated according to its contentSizeHint().  See the
attached clock_update_geometry.patch for the changes to the analog
clock.

The patch adds a FreeLayout class which just resizes its children to
their sizeHint() whenever it is invalidated ( which happens when one
of the child widgets/applets calls their updateGeometry() method ) and
leaves the children in their current positions.  I made some changes
the Corona so that newly created applets are added to the Corona's
layout ( which was apparently created but not used before ) and when
the Corona is created or given a Planar form factor it creates a
FreeLayout to use to manage the applets' geometries.

Regards,
Robert.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: free_layout.patch
Type: text/x-diff
Size: 5244 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20070908/5c20a285/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clock_update_geometry.patch
Type: text/x-diff
Size: 1267 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20070908/5c20a285/attachment-0001.bin 


More information about the Panel-devel mailing list