KConfigWidgets
kcolorscheme.cpp
40 _effects[Intensity] = cfg.readEntry("IntensityEffect", (int)(state == QPalette::Disabled ? IntensityDarken : IntensityNoEffect));
41 _effects[Color] = cfg.readEntry("ColorEffect", (int)(state == QPalette::Disabled ? ColorNoEffect : ColorDesaturate));
42 _effects[Contrast] = cfg.readEntry("ContrastEffect", (int)(state == QPalette::Disabled ? ContrastFade : ContrastTint));
47 _color = cfg.readEntry("Color", state == QPalette::Disabled ? QColor(56, 56, 56) : QColor(112, 111, 110));
223 explicit KColorSchemePrivate(const KSharedConfigPtr &, QPalette::ColorGroup state, KColorScheme::ColorSet set);
247 static SerializedColors loadSerializedColors(const KConfigGroup &group, const SerializedColors &defaults)
268 static DecorationColors loadDecorationColors(const KConfigGroup &group, const DecorationColors &defaults)
276 KColorSchemePrivate::KColorSchemePrivate(const KSharedConfigPtr &config, QPalette::ColorGroup state, KColorScheme::ColorSet set)
294 const bool inactiveSelectionEffect = inactiveEffectGroup.readEntry("ChangeSelectionColor", inactiveEffectGroup.readEntry("Enable", true));
303 tint = KColorSchemePrivate(config, QPalette::Active, KColorScheme::Selection)._brushes.bg[KColorScheme::NormalBackground];
320 defaultDecoColors = loadDecorationColors(config->group("Colors:Window"), defaultDecorationColors);
323 qCWarning(KCONFIG_WIDGETS_LOG) << "ColorSet::NColorSets is not a valid color set value to pass to KColorScheme::KColorScheme";
378 _brushes.bg[KColorScheme::NormalBackground] = effects.brush(_brushes.bg[KColorScheme::NormalBackground]);
379 _brushes.bg[KColorScheme::AlternateBackground] = effects.brush(_brushes.bg[KColorScheme::AlternateBackground]);
497 QColor KColorScheme::shade(const QColor &color, ShadeRole role, qreal contrast, qreal chromaAdjust)
549 void KColorScheme::adjustBackground(QPalette &palette, BackgroundRole newRole, QPalette::ColorRole color,
552 palette.setBrush(QPalette::Active, color, KColorScheme(QPalette::Active, set, config).background(newRole));
553 palette.setBrush(QPalette::Inactive, color, KColorScheme(QPalette::Inactive, set, config).background(newRole));
554 palette.setBrush(QPalette::Disabled, color, KColorScheme(QPalette::Disabled, set, config).background(newRole));
557 void KColorScheme::adjustForeground(QPalette &palette, ForegroundRole newRole, QPalette::ColorRole color,
560 palette.setBrush(QPalette::Active, color, KColorScheme(QPalette::Active, set, config).foreground(newRole));
561 palette.setBrush(QPalette::Inactive, color, KColorScheme(QPalette::Inactive, set, config).foreground(newRole));
562 palette.setBrush(QPalette::Disabled, color, KColorScheme(QPalette::Disabled, set, config).foreground(newRole));
565 bool KColorScheme::isColorSetSupported(const KSharedConfigPtr &config, KColorScheme::ColorSet set)
623 palette.setBrush(state, QPalette::AlternateBase, schemeView.background(KColorScheme::AlternateBackground));
625 palette.setBrush(state, QPalette::LinkVisited, schemeView.foreground(KColorScheme::VisitedText));
const QColor & color() const const
QString readEntry(const char *key, const char *aDefault=nullptr) const
KGUIADDONS_EXPORT qreal luma(const QColor &)
@ NeutralBackground
Seventh color; for example, warnings, secure/encrypted content.
Definition: kcolorscheme.h:181
KGUIADDONS_EXPORT QColor mix(const QColor &c1, const QColor &c2, qreal bias=0.5)
ColorRole
@ NegativeBackground
Sixth color; for example, errors, untrusted content, etc.
Definition: kcolorscheme.h:177
KGUIADDONS_EXPORT QColor darken(const QColor &, qreal amount=0.5, qreal chromaGain=1.0)
static bool isColorSetSupported(const KSharedConfigPtr &config, KColorScheme::ColorSet set)
Used to check if the color scheme has a given set.
Definition: kcolorscheme.cpp:565
QBrush background(BackgroundRole=NormalBackground) const
Retrieve the requested background brush.
Definition: kcolorscheme.cpp:472
static void adjustBackground(QPalette &, BackgroundRole newRole=NormalBackground, QPalette::ColorRole color=QPalette::Base, ColorSet set=View, KSharedConfigPtr=KSharedConfigPtr())
Adjust a QPalette by replacing the specified QPalette::ColorRole with the requested background color ...
Definition: kcolorscheme.cpp:549
@ Header
Colors for header areas that should be used both by the top toolbar and the titlebar.
Definition: kcolorscheme.h:117
@ ActiveText
Third color; for example items which are new, active, requesting attention, etc.
Definition: kcolorscheme.h:225
KGUIADDONS_EXPORT QColor tint(const QColor &base, const QColor &color, qreal amount=0.3)
@ PositiveBackground
Eighth color; for example, success messages, trusted content.
Definition: kcolorscheme.h:185
bool exists() const
bool operator==(const KColorScheme &other) const
Definition: kcolorscheme.cpp:448
bool operator==(const Qt3DRender::QGraphicsApiFilter &reference, const Qt3DRender::QGraphicsApiFilter &sample)
@ NeutralText
Seventh color; for example, warnings, secure/encrypted content.
Definition: kcolorscheme.h:248
KGUIADDONS_EXPORT QColor lighten(const QColor &, qreal amount=0.5, qreal chromaInverseGain=1.0)
static void adjustForeground(QPalette &, ForegroundRole newRole=NormalText, QPalette::ColorRole color=QPalette::Text, ColorSet set=View, KSharedConfigPtr=KSharedConfigPtr())
Adjust a QPalette by replacing the specified QPalette::ColorRole with the requested foreground color ...
Definition: kcolorscheme.cpp:557
@ ShadowShade
The shadow color is darker than light() or midlight() and contrasts the base color.
Definition: kcolorscheme.h:317
@ FocusColor
Color used to draw decorations for items which have input focus.
Definition: kcolorscheme.h:274
bool isEmpty() const const
ForegroundRole
This enumeration describes the foreground color being selected from the given set.
Definition: kcolorscheme.h:209
@ PositiveText
Eighth color; for example, additions, success messages, trusted content.
Definition: kcolorscheme.h:253
void setBrush(QPalette::ColorRole role, const QBrush &brush)
ShadeRole
This enumeration describes the color shade being selected from the given set.
Definition: kcolorscheme.h:295
KSharedConfigPtr config()
ColorSet
This enumeration describes the color set for which a color is being selected.
Definition: kcolorscheme.h:65
@ AlternateBackground
Alternate background; for example, for use in lists.
Definition: kcolorscheme.h:146
QBrush foreground(ForegroundRole=NormalText) const
Retrieve the requested foreground brush.
Definition: kcolorscheme.cpp:477
void setColor(QPalette::ColorGroup group, QPalette::ColorRole role, const QColor &color)
@ InactiveText
Second color; for example, comments, items which are old, inactive or disabled.
Definition: kcolorscheme.h:220
@ LightShade
The light color is lighter than dark() or shadow() and contrasts with the base color.
Definition: kcolorscheme.h:300
KGuiItem defaults()
QColor shade(ShadeRole) const
Retrieve the requested shade color, using KColorScheme::background(KColorScheme::NormalBackground) as...
Definition: kcolorscheme.cpp:487
Definition: kcolorscheme.h:55
static QPalette createApplicationPalette(const KSharedConfigPtr &config)
Used to obtain the QPalette that will be used to set the application palette from KDE Platform theme.
Definition: kcolorscheme.cpp:589
DecorationRole
This enumeration describes the decoration color being selected from the given set.
Definition: kcolorscheme.h:270
QBrush decoration(DecorationRole) const
Retrieve the requested decoration brush.
Definition: kcolorscheme.cpp:482
ColorGroup
KGUIADDONS_EXPORT QColor shade(const QColor &, qreal lumaAmount, qreal chromaAmount=0.0)
static qreal contrastF(const KSharedConfigPtr &config=KSharedConfigPtr())
Returns the contrast for borders as a floating point value.
Definition: kcolorscheme.cpp:466
NoBrush
BackgroundRole
This enumeration describes the background color being selected from the given set.
Definition: kcolorscheme.h:135
@ NegativeText
Sixth color; for example, errors, untrusted content, deletions, etc.
Definition: kcolorscheme.h:244
@ HoverColor
Color used to draw decorations for items which will be activated by clicking.
Definition: kcolorscheme.h:279
@ ActiveBackground
Third color; for example, items which are new, active, requesting attention, etc.
Definition: kcolorscheme.h:156
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Sep 30 2023 04:11:05 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Sep 30 2023 04:11:05 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.