|
|
This is a base class for KDE themed styles. It implements a cache, configuration file parsing, pixmap scaling, gradients, and a lot of inline methods for accessing user specified parameters.
Note that this class *does not* actually implement any themes. It just provides the groundwork for doing so. The only reason to use this class directly is if you plan to reimplement all of the widgets. Otherwise, refer to KThemeStyle for a fully themed style you can derive from.
|
Constructs a new KThemeBase object.
~ |
enum |
Describes if a pixmap should be scaled fully, horizontally, vertically, or not at all and tiled.
enum |
The default arrow types.
enum |
The default frame shading styles.
enum |
The default scrollbar button layout. BottomLeft is like what Next uses, BottomRight is like Platinum, and Opposite it like Windows and Motif.
enum |
The gradient types. Horizontal is left to right, Vertical is top to bottom, and diagonal is upper-left to bottom-right.
enum |
This provides a list of widget types that KThemeBase recognizes.
ScaleHint |
[const]
The scaling type specified by the KConfig file.
Parameters:
widget | A Widgets enum value. |
Returns: A ScaleHint enum value.
Gradient |
[const]
The gradient type specified by the KConfig file.
Parameters:
widget | A Widgets enum value. |
Returns: A Gradient enum value.
const QColorGroup* |
[const]
The color group specified for a given widget. If a color group is set in the theme configuration that is used, otherwise defaultColor is returned.
Parameters:
defaultColor | The colorGroup to set if one is available. |
widget | The widget whose color group to retrieve. |
QBrush |
bool |
[const]
True if the widget has a pixmap or gradient specified.
bool |
[const]
True if the widget has a color group specified.
bool |
[const]
True if the user specified a 3D focus rectangle
int |
[const]
If the user specified a 3D focus rectangle, they may also specify an offset from the default rectangle to use when drawing it. This returns the specified offset.
int |
[const]
The border width of the specified widget.
int |
[const]
Pixmap border width of the specified widget.
KThemePixmap* |
Returns the border pixmap if enabled for the specified widget. This will contain the originial pixmap, plus the edges separated in KThemePixmap::border() if valid. If invalid it will return NULL.
int |
[const]
The highlight width of the specified widget.
int |
[const]
The border plus highlight width of the widget.
int |
[const]
The extent (width for vertical, height for horizontal) requested for the scrollbars.
SButton |
[const]
The scrollbar button layout.
ArrowStyle |
[const]
The arrow type.
ShadeStyle |
[const]
The shading type.
int |
[const]
The frame width.
int |
[const]
The splitter width.
int |
[const]
The contrast for some bevel effects such as reverse gradient.
int |
[const]
The button text X shift.
int |
[const]
The button text Y shift.
int |
[const]
Returns either the slider length of the slider pixmap if available, otherwise the length specified in the config file.
bool |
[const]
True if rounded buttons are requested.
bool |
[const]
True if rounded comboboxes are requested.
bool |
[const]
True if rounded slider grooves are requested.
bool |
[const]
True if a line should be drawn on the bottom of active tabs.
bool |
[const]
True if a line should be drawn on the bottom of inactive tabs.
KThemePixmap* |
[const]
Returns the current uncached pixmap for the given widget. This will usually be either the last scaled or gradient pixmap if those have been specified in the config file, the original pixmap if not, or NULL if no pixmap has been specified.
KThemePixmap * |
[virtual]
Returns the pixmap for the given widget at the specified width and height. This will return NULL if no pixmap or gradient is specified. It may also return a different sized pixmap if the scaling is set to Tiled. When using this method, you should call it using the needed width and height then use QPainter::drawTiledPixmap to paint it. Doing this, if the pixmap is scaled it will be the proper size, otherwise it will be tiled.
Parameters:
w | Requested width. |
h | Requested height. |
widget | Widget type. |
Returns: The pixmap or NULL if one is not specified.
void |
[static]
This method reads a configuration file and applies it to the user's kstylerc file. It does not signal applications to reload via the KDEChangeGeneral atom, if you want to do this you must do so yourself. See kcmdisplay's general.cpp for an example.
Parameters:
file | The configuration file to apply. |
QImage* |
[protected const]
Returns a QImage for the given widget if the widget is scaled, NULL otherwise. QImages of the original pixmap are stored for scaled widgets in order to facilitate fast and accurate smooth-scaling. This also saves us a conversion from a pixmap to an image then back again.
QColor* |
[protected const]
Returns the gradient high color if one is specified, NULL otherwise.
QColor* |
[protected const]
Returns the gradient low color if one is specified, NULL otherwise.
void |
[protected]
Reads in all the configuration file entries supported.
Parameters:
colorStyle | The style for the color groups. In KDE, colors were calculated a little differently for Motif vs Windows styles. This is obsolete. |
void |
[protected]
void |
[protected]
QColorGroup* |
[protected]
Makes a full color group based on the given foreground and background colors. This is the same code used by KDE (kapp.cpp) in previous versions.
KThemePixmap* |
[protected]
KThemePixmap* |
[protected]
KThemePixmap* |
[protected]
KThemePixmap* |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
KThemePixmap* |
[protected]
Attempts to load a pixmap from the default KThemeBase locations.
QImage* |
[protected]
Attempts to load a image from the default KThemeBase locations.