|
Krita Source Code Documentation
|
#include <kcolorscheme.h>
Public Member Functions | |
| QBrush | brush (const QPalette &) const |
| QBrush | brush (const QWidget *) const |
| QBrush | brush (QPalette::ColorGroup) const |
| KStatefulBrush () | |
| KStatefulBrush (const KStatefulBrush &) | |
| KStatefulBrush (const QBrush &, const QBrush &background, KSharedConfigPtr=KSharedConfigPtr()) | |
| KStatefulBrush (const QBrush &, KSharedConfigPtr=KSharedConfigPtr()) | |
| KStatefulBrush (KColorScheme::ColorSet, KColorScheme::BackgroundRole, KSharedConfigPtr=KSharedConfigPtr()) | |
| KStatefulBrush (KColorScheme::ColorSet, KColorScheme::DecorationRole, KSharedConfigPtr=KSharedConfigPtr()) | |
| KStatefulBrush (KColorScheme::ColorSet, KColorScheme::ForegroundRole, KSharedConfigPtr=KSharedConfigPtr()) | |
| KStatefulBrush & | operator= (const KStatefulBrush &) |
| ~KStatefulBrush () | |
Private Attributes | |
| class KStatefulBrushPrivate * | d |
A container for a "state-aware" brush.
KStatefulBrush provides an easy and safe way to store a color for use in a user interface. It is "safe" both in that it will make it easy to deal with widget states in a correct manner, and that it insulates you against changes in QPalette::ColorGroup.
Basically, a stateful brush is used to cache a particular "color" from the KDE system palette (usually, one which does not live in QPalette). When you are ready to draw using the brush, you use the current state to retrieve the appropriate brush.
Stateful brushes can also be used to apply state effects to arbitrary brushes, for example when working with a application specific user-defined color palette.
Definition at line 453 of file kcolorscheme.h.
|
explicit |
Construct a "default" stateful brush. For such an instance, all overloads of KStatefulBrush::brush will return a default brush (i.e. QBrush()).
Definition at line 600 of file kcolorscheme.cpp.
References d.
|
explicit |
Construct a stateful brush from given color set and foreground role, using the colors from the given KConfig (if null, the system colors are used).
Definition at line 605 of file kcolorscheme.cpp.
References d, and KColorScheme::foreground().
|
explicit |
Construct a stateful brush from given color set and background role, using the colors from the given KConfig (if null, the system colors are used).
Definition at line 614 of file kcolorscheme.cpp.
References KColorScheme::background(), and d.
|
explicit |
Construct a stateful brush from given color set and decoration role, using the colors from the given KConfig (if null, the system colors are used).
Definition at line 623 of file kcolorscheme.cpp.
References d, and KColorScheme::decoration().
|
explicit |
Construct a stateful background brush from a specified QBrush (or QColor, via QBrush's implicit constructor). The various states are determined from the base QBrush (which fills in the Active state) according to the same rules used to build stateful color schemes from the system color scheme. The state effects from the given KConfig are used (if null, the system state effects are used).
Definition at line 632 of file kcolorscheme.cpp.
References StateEffects::brush(), brush(), and d.
|
explicit |
Construct a stateful foreground/decoration brush from a specified QBrush (or QColor, via QBrush's implicit constructor). The various states are determined from the base QBrush (which fills in the Active state) according to the same rules used to build stateful color schemes from the system color scheme. The state effects from the given KConfig are used (if null, the system state effects are used).
| brush | The foreground brush |
| background | The background brush (or color) corresponding to the KColorScheme::NormalBackground role and QPalette::Active state for this foreground/decoration color. |
| config | The configuration. |
Definition at line 643 of file kcolorscheme.cpp.
References StateEffects::brush(), brush(), and d.
| KStatefulBrush::KStatefulBrush | ( | const KStatefulBrush & | other | ) |
Construct a copy of another KStatefulBrush.
Definition at line 655 of file kcolorscheme.cpp.
References d.
| KStatefulBrush::~KStatefulBrush | ( | ) |
| QBrush KStatefulBrush::brush | ( | const QPalette & | pal | ) | const |
Retrieve the brush, using a QPalette reference to determine the correct state. Use when your painting code has easy access to the QPalette that it is supposed to be using. The state used in this instance is the currentColorGroup of the palette.
Definition at line 688 of file kcolorscheme.cpp.
References brush().
| QBrush KStatefulBrush::brush | ( | const QWidget * | widget | ) | const |
Retrieve the brush, using a QWidget pointer to determine the correct state. Use when you have a pointer to the widget that you are painting. The state used is the current state of the widget.
QBrush()). Definition at line 693 of file kcolorscheme.cpp.
References brush().
| QBrush KStatefulBrush::brush | ( | QPalette::ColorGroup | state | ) | const |
Retrieve the brush for the specified widget state. This is used when you know explicitly what state is wanted. Otherwise one of overloads is often more convenient.
Definition at line 676 of file kcolorscheme.cpp.
References d.
| KStatefulBrush & KStatefulBrush::operator= | ( | const KStatefulBrush & | other | ) |
|
private |
Definition at line 552 of file kcolorscheme.h.