Commit 4607500a authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Run clang-format

If you want git blame to ignore formatting revisions run:
git config blame.ignoreRevsFile .git-blame-ignore-revs
parent aa601b6a
......@@ -5,9 +5,9 @@
*/
#include <QDir>
#include <QRegularExpression>
#include <QString>
#include <QVariant>
#include <QRegularExpression>
#include "configeditor.h"
......@@ -15,30 +15,31 @@ QString gtk2Theme();
void upgradeGtk2Theme();
void upgradeGtk3Theme();
int main() {
int main()
{
upgradeGtk2Theme();
upgradeGtk3Theme();
return 0;
}
void upgradeGtk2Theme() {
void upgradeGtk2Theme()
{
QString currentGtk2Theme = gtk2Theme();
if (currentGtk2Theme.isEmpty()
|| currentGtk2Theme == QStringLiteral("oxygen-gtk")
|| currentGtk2Theme == QStringLiteral("BreezyGTK")
|| currentGtk2Theme == QStringLiteral("Orion")
) {
if (currentGtk2Theme.isEmpty() //
|| currentGtk2Theme == QStringLiteral("oxygen-gtk") //
|| currentGtk2Theme == QStringLiteral("BreezyGTK") //
|| currentGtk2Theme == QStringLiteral("Orion")) {
ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-theme-name"), QStringLiteral("Breeze"));
}
}
void upgradeGtk3Theme() {
void upgradeGtk3Theme()
{
QString currentGtk3Theme = ConfigEditor::gtk3ConfigValueSettingsIni(QStringLiteral("gtk-theme-name"));
if (currentGtk3Theme.isEmpty()
|| currentGtk3Theme == QStringLiteral("oxygen-gtk")
|| currentGtk3Theme == QStringLiteral("BreezyGTK")
|| currentGtk3Theme == QStringLiteral("Orion")
) {
if (currentGtk3Theme.isEmpty() //
|| currentGtk3Theme == QStringLiteral("oxygen-gtk") //
|| currentGtk3Theme == QStringLiteral("BreezyGTK") //
|| currentGtk3Theme == QStringLiteral("Orion")) {
ConfigEditor::setGtkConfigValueGSettings(QStringLiteral("gtk-theme"), QStringLiteral("Breeze"));
ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-theme-name"), QStringLiteral("Breeze"));
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Net/ThemeName"), QStringLiteral("Breeze"));
......
......@@ -6,22 +6,22 @@
#include <QColor>
#include <QDir>
#include <QList>
#include <QMap>
#include <QProcess>
#include <QRegularExpression>
#include <QStandardPaths>
#include <QProcess>
#include <QVariant>
#include <QMap>
#include <QList>
#include <QTextStream>
#include <QVariant>
#include <KSharedConfig>
#include <KConfigGroup>
#include <KColorScheme>
#include <KColorUtils>
#include <KConfigGroup>
#include <KSharedConfig>
#include <string>
#include <csignal>
#include <cstdio>
#include <string>
#include <gio/gio.h>
......@@ -40,7 +40,7 @@ void ConfigEditor::setGtkConfigValueGSettings(const QString &paramName, const QV
}
}
void ConfigEditor::setGtkConfigValueGSettingsAsEnum(const QString& paramName, int paramValue, const QString& category)
void ConfigEditor::setGtkConfigValueGSettingsAsEnum(const QString &paramName, int paramValue, const QString &category)
{
g_autoptr(GSettings) gsettings = g_settings_new(category.toUtf8().constData());
g_settings_set_enum(gsettings, paramName.toUtf8().constData(), paramValue);
......@@ -122,7 +122,6 @@ void ConfigEditor::setGtk3Colors(const QMap<QString, QColor> &colorsDefinitions)
addGtkModule(QStringLiteral("colorreload-gtk-module"));
}
void ConfigEditor::removeLegacyGtk2Strings()
{
QString gtkrcPath = QDir::homePath() + QStringLiteral("/.gtkrc-2.0");
......@@ -152,7 +151,7 @@ void ConfigEditor::removeLegacyGtk2Strings()
void ConfigEditor::saveWindowDecorationsToAssets(const QStringList &windowDecorationsButtonsImages)
{
QDir assetsFolder {QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + QStringLiteral("/gtk-3.0/assets")};
QDir assetsFolder{QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + QStringLiteral("/gtk-3.0/assets")};
if (!assetsFolder.exists()) {
assetsFolder.mkpath(QStringLiteral("."));
......@@ -167,14 +166,15 @@ void ConfigEditor::saveWindowDecorationsToAssets(const QStringList &windowDecora
void ConfigEditor::addWindowDecorationsCssFile()
{
QFile windowDecorationsCss {QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("/themes/Breeze/window_decorations.css"))};
QString windowDecorationsDestination {QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + QStringLiteral("/gtk-3.0/window_decorations.css")};
QFile windowDecorationsCss{QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("/themes/Breeze/window_decorations.css"))};
QString windowDecorationsDestination{QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation)
+ QStringLiteral("/gtk-3.0/window_decorations.css")};
QFile(windowDecorationsDestination).remove();
windowDecorationsCss.copy(windowDecorationsDestination);
}
void ConfigEditor::addGtkModule(const QString& moduleName)
void ConfigEditor::addGtkModule(const QString &moduleName)
{
const QString currentModulesString = gtk3ConfigValueSettingsIni(QStringLiteral("gtk-modules"));
......@@ -197,8 +197,8 @@ void ConfigEditor::addImportStatementsToGtkCssUserFile()
if (gtkCss.open(QIODevice::ReadWrite)) {
QByteArray gtkCssContents = gtkCss.readAll().trimmed();
static const QVector<QByteArray> importStatements {
QByteArrayLiteral("\n@import 'colors.css';")
static const QVector<QByteArray> importStatements{
QByteArrayLiteral("\n@import 'colors.css';"),
};
for (const auto &statement : importStatements) {
......
......@@ -5,9 +5,9 @@
*/
#pragma once
#include <unistd.h>
#include <QString>
#include <functional>
#include <unistd.h>
class QColor;
class QFile;
......@@ -15,44 +15,43 @@ class QVariant;
namespace ConfigEditor
{
using namespace std::placeholders;
void setGtk2ConfigValue(const QString &paramName, const QVariant &paramValue);
using namespace std::placeholders;
void setGtkConfigValueGSettings(const QString &paramName, const QVariant &paramValue, const QString &category = QStringLiteral("org.gnome.desktop.interface"));
void setGtkConfigValueGSettingsAsEnum(const QString &paramName, int paramValue, const QString &category = QStringLiteral("org.gnome.desktop.interface"));
void setGtk3ConfigValueXSettingsd(const QString &paramName, const QVariant &paramValue);
void setGtk2ConfigValue(const QString &paramName, const QVariant &paramValue);
void setGtkConfigValueSettingsIni(const QString &versionString, const QString &paramName, const QVariant &paramValue);
static auto setGtk4ConfigValueSettingsIni = std::bind(setGtkConfigValueSettingsIni, QStringLiteral("gtk-4.0"), _1, _2);
static auto setGtk3ConfigValueSettingsIni = std::bind(setGtkConfigValueSettingsIni, QStringLiteral("gtk-3.0"), _1, _2);
void setGtkConfigValueGSettings(const QString &paramName, const QVariant &paramValue, const QString &category = QStringLiteral("org.gnome.desktop.interface"));
void setGtkConfigValueGSettingsAsEnum(const QString &paramName, int paramValue, const QString &category = QStringLiteral("org.gnome.desktop.interface"));
void setGtk3ConfigValueXSettingsd(const QString &paramName, const QVariant &paramValue);
QString gtkConfigValueSettingsIni(const QString &versionString, const QString &paramName);
static auto gtk4ConfigValueSettingsIni = std::bind(gtkConfigValueSettingsIni, QStringLiteral("gtk-4.0"), _1);
static auto gtk3ConfigValueSettingsIni = std::bind(gtkConfigValueSettingsIni, QStringLiteral("gtk-3.0"), _1);
void setGtkConfigValueSettingsIni(const QString &versionString, const QString &paramName, const QVariant &paramValue);
static auto setGtk4ConfigValueSettingsIni = std::bind(setGtkConfigValueSettingsIni, QStringLiteral("gtk-4.0"), _1, _2);
static auto setGtk3ConfigValueSettingsIni = std::bind(setGtkConfigValueSettingsIni, QStringLiteral("gtk-3.0"), _1, _2);
void setCustomClientSideDecorations(const QStringList &windowDecorationsButtonsImages);
void disableCustomClientSideDecorations();
void setGtk3Colors(const QMap<QString, QColor> &colorsDefinitions);
QString gtkConfigValueSettingsIni(const QString &versionString, const QString &paramName);
static auto gtk4ConfigValueSettingsIni = std::bind(gtkConfigValueSettingsIni, QStringLiteral("gtk-4.0"), _1);
static auto gtk3ConfigValueSettingsIni = std::bind(gtkConfigValueSettingsIni, QStringLiteral("gtk-3.0"), _1);
void removeLegacyGtk2Strings();
void setCustomClientSideDecorations(const QStringList &windowDecorationsButtonsImages);
void disableCustomClientSideDecorations();
void setGtk3Colors(const QMap<QString, QColor> &colorsDefinitions);
void removeLegacyGtk2Strings();
void saveWindowDecorationsToAssets(const QStringList &windowDecorationsButtonsImages);
void addWindowDecorationsCssFile();
void saveWindowDecorationsToAssets(const QStringList &windowDecorationsButtonsImages);
void addWindowDecorationsCssFile();
void addGtkModule(const QString &moduleName);
void addGtkModule(const QString &moduleName);
void addImportStatementsToGtkCssUserFile();
void removeWindowDecorationsCSS();
void modifyColorsCssFile(const QMap<QString, QColor> &colorsDefinitions);
void addImportStatementsToGtkCssUserFile();
void removeWindowDecorationsCSS();
void modifyColorsCssFile(const QMap<QString, QColor> &colorsDefinitions);
void replaceValueInGtkrcContents(QString &gtkrcContents, const QString &paramName, const QVariant &paramValue);
void replaceValueInXSettingsdContents(QString &xSettingsdContents, const QString &paramName, const QVariant &paramValue);
void replaceValueInGtkrcContents(QString &gtkrcContents, const QString &paramName, const QVariant &paramValue);
void replaceValueInXSettingsdContents(QString &xSettingsdContents, const QString &paramName, const QVariant &paramValue);
QString readFileContents(QFile &gtkrc);
QString readFileContents(QFile &gtkrc);
void reloadXSettingsd();
void reloadXSettingsd();
pid_t pidOfXSettingsd();
pid_t pidOfXSettingsd();
};
This diff is collapsed.
......@@ -5,26 +5,26 @@
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
#include <QFont>
#include <QDBusConnection>
#include <QDBusMessage>
#include <QFont>
#include <QGuiApplication>
#include <KPluginFactory>
#include <KColorScheme>
#include <KPluginFactory>
#include "gtkconfig.h"
K_PLUGIN_CLASS_WITH_JSON(GtkConfig, "gtkconfig.json")
GtkConfig::GtkConfig(QObject *parent, const QVariantList&) :
KDEDModule(parent),
configValueProvider(new ConfigValueProvider()),
themePreviewer(new ThemePreviewer(this)),
kdeglobalsConfigWatcher(KConfigWatcher::create(KSharedConfig::openConfig())),
kwinConfigWatcher(KConfigWatcher::create(KSharedConfig::openConfig(QStringLiteral("kwinrc")))),
kcminputConfigWatcher(KConfigWatcher::create(KSharedConfig::openConfig(QStringLiteral("kcminputrc")))),
breezeConfigWatcher(KConfigWatcher::create(KSharedConfig::openConfig(QStringLiteral("breezerc"))))
GtkConfig::GtkConfig(QObject *parent, const QVariantList &)
: KDEDModule(parent)
, configValueProvider(new ConfigValueProvider())
, themePreviewer(new ThemePreviewer(this))
, kdeglobalsConfigWatcher(KConfigWatcher::create(KSharedConfig::openConfig()))
, kwinConfigWatcher(KConfigWatcher::create(KSharedConfig::openConfig(QStringLiteral("kwinrc"))))
, kcminputConfigWatcher(KConfigWatcher::create(KSharedConfig::openConfig(QStringLiteral("kcminputrc"))))
, breezeConfigWatcher(KConfigWatcher::create(KSharedConfig::openConfig(QStringLiteral("breezerc"))))
{
QDBusConnection dbus = QDBusConnection::sessionBus();
dbus.registerService(QStringLiteral("org.kde.GtkConfig"));
......@@ -52,7 +52,7 @@ void GtkConfig::setGtkTheme(const QString &themeName) const
ConfigEditor::setGtkConfigValueGSettings(QStringLiteral("gtk-theme"), themeName);
ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-theme-name"), themeName);
ConfigEditor::setGtk4ConfigValueSettingsIni(QStringLiteral("gtk-theme-name"), themeName);
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Net/ThemeName"), themeName);
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Net/ThemeName"), themeName);
// Window decorations are part of the theme, in case of Breeze we inject custom ones from KWin
setWindowDecorationsAppearance();
......@@ -63,7 +63,7 @@ QString GtkConfig::gtkTheme() const
return ConfigEditor::gtk3ConfigValueSettingsIni(QStringLiteral("gtk-theme-name"));
}
void GtkConfig::showGtkThemePreview(const QString& themeName) const
void GtkConfig::showGtkThemePreview(const QString &themeName) const
{
themePreviewer->showGtk3App(themeName);
}
......@@ -75,7 +75,7 @@ void GtkConfig::setFont() const
ConfigEditor::setGtkConfigValueGSettings(QStringLiteral("font-name"), configFontName);
ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-font-name"), configFontName);
ConfigEditor::setGtk4ConfigValueSettingsIni(QStringLiteral("gtk-font-name"), configFontName);
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/FontName"), configFontName);
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/FontName"), configFontName);
}
void GtkConfig::setIconTheme() const
......@@ -85,7 +85,7 @@ void GtkConfig::setIconTheme() const
ConfigEditor::setGtkConfigValueGSettings(QStringLiteral("icon-theme"), iconThemeName);
ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-icon-theme-name"), iconThemeName);
ConfigEditor::setGtk4ConfigValueSettingsIni(QStringLiteral("gtk-icon-theme-name"), iconThemeName);
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Net/IconThemeName"), iconThemeName);
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Net/IconThemeName"), iconThemeName);
}
void GtkConfig::setCursorTheme() const
......@@ -95,7 +95,7 @@ void GtkConfig::setCursorTheme() const
ConfigEditor::setGtkConfigValueGSettings(QStringLiteral("cursor-theme"), cursorThemeName);
ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-cursor-theme-name"), cursorThemeName);
ConfigEditor::setGtk4ConfigValueSettingsIni(QStringLiteral("gtk-cursor-theme-name"), cursorThemeName);
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/CursorThemeName"), cursorThemeName);
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/CursorThemeName"), cursorThemeName);
}
void GtkConfig::setCursorSize() const
......@@ -105,7 +105,7 @@ void GtkConfig::setCursorSize() const
ConfigEditor::setGtkConfigValueGSettings(QStringLiteral("cursor-size"), cursorSize);
ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-cursor-theme-size"), cursorSize);
ConfigEditor::setGtk4ConfigValueSettingsIni(QStringLiteral("gtk-cursor-theme-size"), cursorSize);
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/CursorThemeSize"), cursorSize);
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/CursorThemeSize"), cursorSize);
}
void GtkConfig::setIconsOnButtons() const
......@@ -242,7 +242,7 @@ void GtkConfig::onKdeglobalsSettingsChange(const KConfigGroup &group, const QByt
void GtkConfig::onKWinSettingsChange(const KConfigGroup &group, const QByteArrayList &names) const
{
if (group.name() == QStringLiteral("org.kde.kdecoration2")) {
if (names.contains(QByteArrayLiteral("ButtonsOnRight"))
if (names.contains(QByteArrayLiteral("ButtonsOnRight")) //
|| names.contains(QByteArrayLiteral("ButtonsOnLeft"))) {
setWindowDecorationsButtonsOrder();
}
......@@ -252,7 +252,7 @@ void GtkConfig::onKWinSettingsChange(const KConfigGroup &group, const QByteArray
}
}
void GtkConfig::onKCMInputSettingsChange(const KConfigGroup& group, const QByteArrayList& names) const
void GtkConfig::onKCMInputSettingsChange(const KConfigGroup &group, const QByteArrayList &names) const
{
if (group.name() == QStringLiteral("Mouse")) {
if (names.contains("cursorTheme")) {
......@@ -264,13 +264,12 @@ void GtkConfig::onKCMInputSettingsChange(const KConfigGroup& group, const QByteA
}
}
void GtkConfig::onBreezeSettingsChange(const KConfigGroup& group, const QByteArrayList& names) const
void GtkConfig::onBreezeSettingsChange(const KConfigGroup &group, const QByteArrayList &names) const
{
if (group.name() == QStringLiteral("Common")
&& names.contains("OutlineCloseButton")) {
if (group.name() == QStringLiteral("Common") //
&& names.contains("OutlineCloseButton")) {
setWindowDecorationsAppearance();
}
}
#include "gtkconfig.moc"
......@@ -7,8 +7,8 @@
#pragma once
#include <KDEDModule>
#include <KConfigWatcher>
#include <KDEDModule>
#include "configeditor.h"
#include "configvalueprovider.h"
......@@ -20,7 +20,7 @@ class Q_DECL_EXPORT GtkConfig : public KDEDModule
Q_CLASSINFO("D-Bus Interface", "org.kde.GtkConfig")
public:
GtkConfig(QObject *parent, const QVariantList& args);
GtkConfig(QObject *parent, const QVariantList &args);
~GtkConfig();
void setFont() const;
......
......@@ -4,16 +4,16 @@
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
#include <QFile>
#include <QStandardPaths>
#include <QSvgRenderer>
#include "auroraedecorationpainter.h"
const QString AuroraeDecorationPainter::s_auroraeThemesPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/aurorae/themes/");
const QString AuroraeDecorationPainter::s_auroraeThemesPath =
QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/aurorae/themes/");
AuroraeDecorationPainter::AuroraeDecorationPainter(const QString& themeName)
AuroraeDecorationPainter::AuroraeDecorationPainter(const QString &themeName)
: DecorationPainter()
, m_themeName(themeName)
, m_themePath(s_auroraeThemesPath + themeName + '/')
......@@ -46,7 +46,7 @@ QString AuroraeDecorationPainter::buttonTypeToFileName(const QString &buttonType
}
}
QString AuroraeDecorationPainter::buttonStateToElementId(const QString& buttonState) const
QString AuroraeDecorationPainter::buttonStateToElementId(const QString &buttonState) const
{
// Aurorae themes do not contain pressed and hovered inactive states,
// so we put backdrop option to the end, so that first we use pressed and hover ones
......@@ -60,5 +60,3 @@ QString AuroraeDecorationPainter::buttonStateToElementId(const QString& buttonSt
return QStringLiteral("active-center");
}
}
......@@ -6,15 +6,15 @@
#include "decorationpainter.h"
#include <QString>
#include <QRect>
#include <QString>
#include "standarddecorationpainter.h"
#include "auroraedecorationpainter.h"
#include "standarddecorationpainter.h"
const QRect DecorationPainter::ButtonGeometry {0, 0, 50, 50};
const QRect DecorationPainter::ButtonGeometry{0, 0, 50, 50};
std::unique_ptr<DecorationPainter> DecorationPainter::fromThemeName(const QString& themeName)
std::unique_ptr<DecorationPainter> DecorationPainter::fromThemeName(const QString &themeName)
{
static const QString auroraeThemePrefix = QStringLiteral("__aurorae__svg__");
if (themeName.startsWith(auroraeThemePrefix)) {
......@@ -24,4 +24,3 @@ std::unique_ptr<DecorationPainter> DecorationPainter::fromThemeName(const QStrin
return std::unique_ptr<StandardDecorationPainter>{new StandardDecorationPainter(themeName)};
}
}
......@@ -11,9 +11,9 @@ SPDX-License-Identifier: GPL-2.0-or-later
#include "decorationpalette.h"
#include <KColorScheme>
#include <KConfigGroup>
#include <KSharedConfig>
#include <KColorScheme>
#include <QFileInfo>
#include <QStandardPaths>
......@@ -22,11 +22,8 @@ namespace KWin
{
namespace Decoration
{
DecorationPalette::DecorationPalette(const QString &colorScheme)
: m_colorScheme(QFileInfo(colorScheme).isAbsolute()
? colorScheme
: QStandardPaths::locate(QStandardPaths::GenericConfigLocation, colorScheme))
: m_colorScheme(QFileInfo(colorScheme).isAbsolute() ? colorScheme : QStandardPaths::locate(QStandardPaths::GenericConfigLocation, colorScheme))
{
if (!m_colorScheme.startsWith(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation)) && colorScheme == QStringLiteral("kdeglobals")) {
// kdeglobals doesn't exist so create it. This is needed to monitor it using QFileSystemWatcher.
......@@ -54,41 +51,41 @@ bool DecorationPalette::isValid() const
QColor DecorationPalette::color(KDecoration2::ColorGroup group, KDecoration2::ColorRole role) const
{
using KDecoration2::ColorRole;
using KDecoration2::ColorGroup;
using KDecoration2::ColorRole;
switch (role) {
case ColorRole::Frame:
switch (group) {
case ColorGroup::Active:
return m_activeFrameColor;
case ColorGroup::Inactive:
return m_inactiveFrameColor;
default:
return QColor();
}
case ColorRole::TitleBar:
switch (group) {
case ColorGroup::Active:
return m_activeTitleBarColor;
case ColorGroup::Inactive:
return m_inactiveTitleBarColor;
default:
return QColor();
}
case ColorRole::Foreground:
switch (group) {
case ColorGroup::Active:
return m_activeForegroundColor;
case ColorGroup::Inactive:
return m_inactiveForegroundColor;
case ColorGroup::Warning:
return m_warningForegroundColor;
default:
return QColor();
}
case ColorRole::Frame:
switch (group) {
case ColorGroup::Active:
return m_activeFrameColor;
case ColorGroup::Inactive:
return m_inactiveFrameColor;
default:
return QColor();
}
case ColorRole::TitleBar:
switch (group) {
case ColorGroup::Active:
return m_activeTitleBarColor;
case ColorGroup::Inactive:
return m_inactiveTitleBarColor;
default:
return QColor();
}
case ColorRole::Foreground:
switch (group) {
case ColorGroup::Active:
return m_activeForegroundColor;
case ColorGroup::Inactive:
return m_inactiveForegroundColor;
case ColorGroup::Warning:
return m_warningForegroundColor;
default:
return QColor();
}
default:
return QColor();
}
}
......@@ -108,16 +105,15 @@ void DecorationPalette::update()
m_palette = KColorScheme::createApplicationPalette(config);
m_activeFrameColor = wmConfig.readEntry("frame", m_palette.color(QPalette::Active, QPalette::Window));
m_inactiveFrameColor = wmConfig.readEntry("inactiveFrame", m_activeFrameColor);
m_activeTitleBarColor = wmConfig.readEntry("activeBackground", m_palette.color(QPalette::Active, QPalette::Highlight));
m_inactiveTitleBarColor = wmConfig.readEntry("inactiveBackground", m_inactiveFrameColor);
m_activeForegroundColor = wmConfig.readEntry("activeForeground", m_palette.color(QPalette::Active, QPalette::HighlightedText));
m_activeFrameColor = wmConfig.readEntry("frame", m_palette.color(QPalette::Active, QPalette::Window));
m_inactiveFrameColor = wmConfig.readEntry("inactiveFrame", m_activeFrameColor);
m_activeTitleBarColor = wmConfig.readEntry("activeBackground", m_palette.color(QPalette::Active, QPalette::Highlight));
m_inactiveTitleBarColor = wmConfig.readEntry("inactiveBackground", m_inactiveFrameColor);
m_activeForegroundColor = wmConfig.readEntry("activeForeground", m_palette.color(QPalette::Active, QPalette::HighlightedText));
m_inactiveForegroundColor = wmConfig.readEntry("inactiveForeground", m_activeForegroundColor.darker());
KConfigGroup windowColorsConfig(config, QStringLiteral("Colors:Window"));
m_warningForegroundColor = windowColorsConfig.readEntry("ForegroundNegative", QColor(237, 21, 2));
}
}
......
......@@ -20,7 +20,6 @@ namespace KWin
{
namespace Decoration
{
class DecorationPalette : public QObject
{
Q_OBJECT
......@@ -34,6 +33,7 @@ public:
Q_SIGNALS:
void changed();
private:
void update();
......
......@@ -6,15 +6,14 @@
#include "dummydecoratedclient.h"
namespace KDecoration2 {
namespace KDecoration2
{
DummyDecoratedClient::DummyDecoratedClient(DecoratedClient *client, Decoration *decoration)
: DecoratedClientPrivate(client, decoration)
, m_pallete(QStringLiteral("kdeglobals"))
, m_maximized()
, m_active(true)
{
}
bool DummyDecoratedClient::isActive() const
......
......@@ -12,9 +12,10 @@
#include "decorationpalette.h"
namespace KDecoration2 {
class DummyDecoratedClient : public QObject, public DecoratedClientPrivate {
namespace KDecoration2
{
class DummyDecoratedClient : public QObject, public DecoratedClientPrivate
{
Q_OBJECT
public:
DummyDecoratedClient(DecoratedClient *client, Decoration *decoration);
......
......@@ -7,24 +7,23 @@
#include <QCoreApplication>
#include <QMouseEvent>
#include <KDecoration2/DecorationSettings>
#include <KConfigGroup>
#include <KDecoration2/DecoratedClient>
#include <KDecoration2/DecorationSettings>
#include <KDecoration2/Private/DecoratedClientPrivate>
#include <KDecoration2/Private/DecorationSettingsPrivate>