KColorScheme
kcolorschememanager.cpp
37 return QGuiApplicationPrivate::platformTheme() && QGuiApplicationPrivate::platformTheme()->name() == QLatin1String("kde");
42 // hint for plasma-integration to synchronize the color scheme with the window manager/compositor
49 qApp->setPalette(KColorScheme::createApplicationPalette(KSharedConfig::openConfig(colorSchemePath)));
55// On other platforms we automatically apply Breeze/Breeze Dark depending on the system preference
62 const QString colorSchemeId = m_colorSchemeWatcher->systemPreference() == KColorSchemeWatcher::PreferDark ? getDarkColorScheme() : getLightColorScheme();
127 QObject::connect(&*d->m_colorSchemeWatcher, &KColorSchemeWatcher::systemPreferenceChanged, this, [this]() {
A small helper to get access to all available color schemes and activating a scheme in the QApplicati...
Definition kcolorschememanager.h:54
QAbstractItemModel * model() const
A QAbstractItemModel of all available color schemes.
Definition kcolorschememanager.cpp:164
QString activeSchemeId() const
Returns the id of the currently active scheme or an empty string if the default scheme is active.
Definition kcolorschememanager.cpp:236
QModelIndex indexForScheme(const QString &name) const
Returns the model index for the scheme with the given name.
Definition kcolorschememanager.cpp:194
QModelIndex indexForSchemeId(const QString &id) const
Returns the model index for the scheme with the given id.
Definition kcolorschememanager.cpp:185
static KColorSchemeManager * instance()
Returns the manager for the current application instance.
Definition kcolorschememanager.cpp:246
void activateScheme(const QModelIndex &index)
Activates the KColorScheme identified by the provided index.
Definition kcolorschememanager.cpp:209
QString activeSchemeName() const
Returns the name of the currently active scheme or an empty string if the default scheme is active.
Definition kcolorschememanager.cpp:241
void saveSchemeToConfigFile(const QString &schemeName) const
Saves the color scheme to config file.
Definition kcolorschememanager.cpp:228
void setAutosaveChanges(bool autosaveChanges)
Sets color scheme autosaving.
Definition kcolorschememanager.cpp:180
A model listing the KColorSchemes available in the system.
Definition kcolorschememodel.h:27
PreferDark
void systemPreferenceChanged()
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
void writeEntry(const char *key, const char *value, WriteConfigFlags pFlags=Normal)
bool sync() override
SimpleConfig
static QString removeAcceleratorMarker(const QString &label)
void init(KXmlGuiWindow *window, KGameDifficulty *difficulty=nullptr)
void addPixmap(const QPixmap &pixmap, Mode mode, State state)
QVariant data(int role) const const
bool isValid() const const
const QAbstractItemModel * model() const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
bool begin(QPaintDevice *device)
bool end()
void fillRect(const QRect &rectangle, QGradient::Preset preset)
Active
QChar * data()
bool isEmpty() const const
black
QString toString() 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.