KColorScheme
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);
247static SerializedColors loadSerializedColors(const KConfigGroup &group, const SerializedColors &defaults)
268static DecorationColors loadDecorationColors(const KConfigGroup &group, const DecorationColors &defaults)
276KColorSchemePrivate::KColorSchemePrivate(const KSharedConfigPtr &config, QPalette::ColorGroup state, KColorScheme::ColorSet set)
294 const bool inactiveSelectionEffect = inactiveEffectGroup.readEntry("ChangeSelectionColor", inactiveEffectGroup.readEntry("Enable", true));
303 tint = config->group(QStringLiteral("Colors:Selection")).readEntry("BackgroundNormal", defaultSelectionColors.NormalBackground);
319 defaultColors = loadSerializedColors(config->group(QStringLiteral("Colors:Window")), defaultHeaderColors);
320 defaultDecoColors = loadDecorationColors(config->group(QStringLiteral("Colors:Window")), defaultDecorationColors);
323 qCWarning(KCOLORSCHEME) << "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]);
488QColor KColorScheme::shade(const QColor &color, ShadeRole role, qreal contrast, qreal chromaAdjust)
540void KColorScheme::adjustBackground(QPalette &palette, BackgroundRole newRole, QPalette::ColorRole color,
543 palette.setBrush(QPalette::Active, color, KColorScheme(QPalette::Active, set, config).background(newRole));
544 palette.setBrush(QPalette::Inactive, color, KColorScheme(QPalette::Inactive, set, config).background(newRole));
545 palette.setBrush(QPalette::Disabled, color, KColorScheme(QPalette::Disabled, set, config).background(newRole));
548void KColorScheme::adjustForeground(QPalette &palette, ForegroundRole newRole, QPalette::ColorRole color,
551 palette.setBrush(QPalette::Active, color, KColorScheme(QPalette::Active, set, config).foreground(newRole));
552 palette.setBrush(QPalette::Inactive, color, KColorScheme(QPalette::Inactive, set, config).foreground(newRole));
553 palette.setBrush(QPalette::Disabled, color, KColorScheme(QPalette::Disabled, set, config).foreground(newRole));
556bool KColorScheme::isColorSetSupported(const KSharedConfigPtr &config, KColorScheme::ColorSet set)
607 palette.setBrush(state, QPalette::PlaceholderText, schemeView.foreground(KColorScheme::InactiveText));
616 palette.setBrush(state, QPalette::AlternateBase, schemeView.background(KColorScheme::AlternateBackground));
618 palette.setBrush(state, QPalette::LinkVisited, schemeView.foreground(KColorScheme::VisitedText));
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:548
ForegroundRole
This enumeration describes the foreground color being selected from the given set.
Definition kcolorscheme.h:209
@ ActiveText
Third color; for example items which are new, active, requesting attention, etc.
Definition kcolorscheme.h:225
@ NeutralText
Seventh color; for example, warnings, secure/encrypted content.
Definition kcolorscheme.h:248
@ InactiveText
Second color; for example, comments, items which are old, inactive or disabled.
Definition kcolorscheme.h:220
@ NegativeText
Sixth color; for example, errors, untrusted content, deletions, etc.
Definition kcolorscheme.h:244
@ PositiveText
Eighth color; for example, additions, success messages, trusted content.
Definition kcolorscheme.h:253
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:580
bool operator==(const KColorScheme &other) const
Definition kcolorscheme.cpp:448
ShadeRole
This enumeration describes the color shade being selected from the given set.
Definition kcolorscheme.h:295
@ LightShade
The light color is lighter than dark() or shadow() and contrasts with the base color.
Definition kcolorscheme.h:300
@ ShadowShade
The shadow color is darker than light() or midlight() and contrasts the base color.
Definition kcolorscheme.h:317
BackgroundRole
This enumeration describes the background color being selected from the given set.
Definition kcolorscheme.h:135
@ PositiveBackground
Eighth color; for example, success messages, trusted content.
Definition kcolorscheme.h:185
@ NeutralBackground
Seventh color; for example, warnings, secure/encrypted content.
Definition kcolorscheme.h:181
@ AlternateBackground
Alternate background; for example, for use in lists.
Definition kcolorscheme.h:146
@ ActiveBackground
Third color; for example, items which are new, active, requesting attention, etc.
Definition kcolorscheme.h:156
@ NegativeBackground
Sixth color; for example, errors, untrusted content, etc.
Definition kcolorscheme.h:177
ColorSet
This enumeration describes the color set for which a color is being selected.
Definition kcolorscheme.h:65
@ Header
Colors for header areas that should be used both by the top toolbar and the titlebar.
Definition kcolorscheme.h:117
static qreal contrastF(const KSharedConfigPtr &config=KSharedConfigPtr())
Returns the contrast for borders as a floating point value.
Definition kcolorscheme.cpp:457
static bool isColorSetSupported(const KSharedConfigPtr &config, KColorScheme::ColorSet set)
Used to check if the color scheme has a given set.
Definition kcolorscheme.cpp:556
QBrush background(BackgroundRole=NormalBackground) const
Retrieve the requested background brush.
Definition kcolorscheme.cpp:463
DecorationRole
This enumeration describes the decoration color being selected from the given set.
Definition kcolorscheme.h:270
@ HoverColor
Color used to draw decorations for items which will be activated by clicking.
Definition kcolorscheme.h:279
@ FocusColor
Color used to draw decorations for items which have input focus.
Definition kcolorscheme.h:274
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:540
QBrush decoration(DecorationRole) const
Retrieve the requested decoration brush.
Definition kcolorscheme.cpp:473
QColor shade(ShadeRole) const
Retrieve the requested shade color, using KColorScheme::background(KColorScheme::NormalBackground) as...
Definition kcolorscheme.cpp:478
QBrush foreground(ForegroundRole=NormalText) const
Retrieve the requested foreground brush.
Definition kcolorscheme.cpp:468
QString readEntry(const char *key, const char *aDefault=nullptr) const
bool exists() const
KGUIADDONS_EXPORT QColor darken(const QColor &, qreal amount=0.5, qreal chromaGain=1.0)
KGUIADDONS_EXPORT qreal luma(const QColor &)
KGUIADDONS_EXPORT QColor shade(const QColor &, qreal lumaAmount, qreal chromaAmount=0.0)
KGUIADDONS_EXPORT QColor mix(const QColor &c1, const QColor &c2, qreal bias=0.5)
KGUIADDONS_EXPORT QColor tint(const QColor &base, const QColor &color, qreal amount=0.3)
KGUIADDONS_EXPORT QColor lighten(const QColor &, qreal amount=0.5, qreal chromaInverseGain=1.0)
KGuiItem defaults()
const QColor & color() const const
bool isValid() const const
ColorGroup
ColorRole
void setBrush(ColorGroup group, ColorRole role, const QBrush &brush)
void setColor(ColorGroup group, ColorRole role, const QColor &color)
bool isEmpty() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:02:22 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:02:22 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.