KColorScheme
kcolorschememanager.cpp
46 if (qgetenv("XDG_CURRENT_DESKTOP") == "KDE" && QGuiApplicationPrivate::platformTheme()->name() == QLatin1String("xdgdesktopportal")) {
55 // hint for plasma-integration to synchronize the color scheme with the window manager/compositor
62 qApp->setPalette(KColorScheme::createApplicationPalette(KSharedConfig::openConfig(colorSchemePath)));
68// On other platforms we automatically apply Breeze/Breeze Dark depending on the system preference
75 const QString colorSchemeId = m_colorSchemeWatcher->systemPreference() == KColorSchemeWatcher::PreferDark ? getDarkColorScheme() : getLightColorScheme();
140 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:177
QString activeSchemeId() const
Returns the id of the currently active scheme or an empty string if the default scheme is active.
Definition kcolorschememanager.cpp:249
QModelIndex indexForScheme(const QString &name) const
Returns the model index for the scheme with the given name.
Definition kcolorschememanager.cpp:207
QModelIndex indexForSchemeId(const QString &id) const
Returns the model index for the scheme with the given id.
Definition kcolorschememanager.cpp:198
static KColorSchemeManager * instance()
Returns the manager for the current application instance.
Definition kcolorschememanager.cpp:259
void activateScheme(const QModelIndex &index)
Activates the KColorScheme identified by the provided index.
Definition kcolorschememanager.cpp:222
QString activeSchemeName() const
Returns the name of the currently active scheme or an empty string if the default scheme is active.
Definition kcolorschememanager.cpp:254
void saveSchemeToConfigFile(const QString &schemeName) const
Saves the color scheme to config file.
Definition kcolorschememanager.cpp:241
void setAutosaveChanges(bool autosaveChanges)
Sets color scheme autosaving.
Definition kcolorschememanager.cpp:193
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)
QString name(StandardAction id)
QCA_EXPORT void init()
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 Sat Dec 21 2024 17:05:51 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:05:51 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.