(→Category Names) |
(rough sizing info added) |
||
| Line 33: | Line 33: | ||
== Configuration == | == Configuration == | ||
| + | |||
| + | - applets should *not* store or retrieve their own size from config(). | ||
| + | Plasma::Applet does that for us. | ||
== Status Notifications == | == Status Notifications == | ||
== Packaging Conventions == | == Packaging Conventions == | ||
| + | |||
| + | == Layouts and Sizing == | ||
| + | |||
| + | To set your initial size, call setSize(). same for setMaximumSize() and setMinimumSize(). if you need to change the size, call resize(). | ||
| + | |||
| + | If you need to be notified when your plasmoid is resized, then implement constraintUpdated and check for a sizeconstraint. your new size is given by contentSize(). | ||
| + | |||
| + | |||
| + | - resize to a reasonable default in the constructor (whatever that means for | ||
| + | the config) | ||
| + | |||
| + | - only over ride contentSizeHint if there is good reason to (e.g. aspect ratio | ||
| + | is important, the systemtray, etc) | ||
| + | |||
| + | - if the applet needs to resize at runtime because of changing content, this | ||
| + | is ok to do. just be careful of the form factor. | ||
| + | |||
| + | - setting a minimum size is a good idea for applets that need a certain amount | ||
| + | of room no matter what | ||
Contents |
This document is a place to collect all the "do"s, "don't"s and "how to"s for interface elements in Plasma, particularly applets and plasmoids.
The following are acceptable known entries for plasmoids and applets. If your applet does not fall within one of the following categories, leave the category field empty (it will be automatically categories under "Miscellaneous" for the time being) and contact the Plasma development team to have a suitable category added to the list (at which point you may then use that category).
Questions from a futur plasmoid programmer. I find those categories ambiguous. For instance:
- applets should *not* store or retrieve their own size from config(). Plasma::Applet does that for us.
To set your initial size, call setSize(). same for setMaximumSize() and setMinimumSize(). if you need to change the size, call resize().
If you need to be notified when your plasmoid is resized, then implement constraintUpdated and check for a sizeconstraint. your new size is given by contentSize().
- resize to a reasonable default in the constructor (whatever that means for
the config)
- only over ride contentSizeHint if there is good reason to (e.g. aspect ratio is important, the systemtray, etc)
- if the applet needs to resize at runtime because of changing content, this is ok to do. just be careful of the form factor.
- setting a minimum size is a good idea for applets that need a certain amount of room no matter what