Introduction to KDE widget themes
At the very basic level KDE widget themes and styles are accomplished by
allowing programmers to reimplement how widgets are painted as well as
some user interaction parameters. When the developer makes a complete set of
routines to draw all of the widgets this is called a "style". Examples of
widget styles in KDE are Platinum, CDE, Windows, Motif, KStep, and Pillbox.
In KDE, one of these styles can read a configuration file to determine how
widgets should be drawn. This configuration file is called a "theme", and
is what most of this tutorial focuses on. Examples of widget themes in KDE
include System and Marble.
Feature overview
- KDE allows people to easily design both themes and dedicated widget drawing
plugins that are dynamically loaded and configurable at runtime.
- Included in KDE is an advanced effects engine with built in gradient and
blending support that is fully accessible to people designing KDE themes. This
is in addition to the effects included in the KDE/Qt base classes such as
fast smooth-scaling.
- KDE themes are fast. Really fast. Even themes using pixmaps and gradients
should run at a decent speed. This is mostly due to how pixmaps are stored
and a very optimized cache mechanism.
- Dedicated cache. As mentioned above, the theme plugin has a cache designed
specifically for pixmap and gradient themes. Besides greatly increasing the
speed of widget themes it also is configurable in size and has automatic
flushing of old data. If themes are designed well the cache should also always
be relatively small. It can also be disabled for fast machines that don't need
it.
Theme configuration file layout
The default theme plugin reads configuration files stored in the standard
KDE configuration file format. These files are organized as a group name
enclosed in brackets [], followed by several keys to set parameters for that
group. For example:
[PushButton]
Border=2
This sets the the Border value to 2 for the PushButton group. You will find
all widgets are configured in a similar manner.
The theme configuration files read by KDE can be stored in
~/.kde/share/apps/kstyle/themes and the global share/apps/kstyle/themes. They
should all end in the extension .themerc.
The pixmaps used by KDE can be stored in
~/.kde/share/apps/kstyle/pixmaps and the global share/apps/kstyle/pixmaps. The
standard format for pixmaps are PNG.
Some tools you might be interested in
In addition to the obvious KDE tools (KIconEdit, KView, etc...) that will be useful to
you as you create themes there are some less obvious KDE and non-KDE utilities
you may be interested in. Here is a brief list:
<< Previous Page
|
Next Page >>
Mail Mosfet