2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2015-03-31 13:26:42 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
|
|
|
|
SPDX-FileCopyrightText: 2014 Hugo Pereira Da Costa <hugo.pereira@free.fr>
|
|
|
|
SPDX-FileCopyrightText: 2015 Mika Allan Rauhala <mika.allan.rauhala@gmail.com>
|
2020-08-02 22:10:35 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2015-03-31 13:26:42 +00:00
|
|
|
|
|
|
|
#ifndef KWIN_DECORATION_PALETTE_H
|
|
|
|
#define KWIN_DECORATION_PALETTE_H
|
|
|
|
|
|
|
|
#include <KDecoration2/DecorationSettings>
|
|
|
|
#include <QFileSystemWatcher>
|
|
|
|
#include <QPalette>
|
2020-05-27 21:00:26 +00:00
|
|
|
#include <KSharedConfig>
|
|
|
|
#include <KColorScheme>
|
|
|
|
#include <KConfigWatcher>
|
|
|
|
|
|
|
|
#include <optional>
|
2015-03-31 13:26:42 +00:00
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
namespace Decoration
|
|
|
|
{
|
|
|
|
|
|
|
|
class DecorationPalette : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
DecorationPalette(const QString &colorScheme);
|
|
|
|
|
|
|
|
bool isValid() const;
|
|
|
|
|
|
|
|
QColor color(KDecoration2::ColorGroup group, KDecoration2::ColorRole role) const;
|
|
|
|
QPalette palette() const;
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void changed();
|
|
|
|
private:
|
|
|
|
void update();
|
|
|
|
|
|
|
|
QString m_colorScheme;
|
2020-05-27 21:00:26 +00:00
|
|
|
KConfigWatcher::Ptr m_watcher;
|
|
|
|
|
|
|
|
struct LegacyPalette {
|
|
|
|
QPalette palette;
|
|
|
|
|
|
|
|
QColor activeTitleBarColor;
|
|
|
|
QColor inactiveTitleBarColor;
|
|
|
|
|
|
|
|
QColor activeFrameColor;
|
|
|
|
QColor inactiveFrameColor;
|
2015-03-31 13:26:42 +00:00
|
|
|
|
2020-05-27 21:00:26 +00:00
|
|
|
QColor activeForegroundColor;
|
|
|
|
QColor inactiveForegroundColor;
|
|
|
|
QColor warningForegroundColor;
|
|
|
|
};
|
2015-03-31 13:26:42 +00:00
|
|
|
|
2020-05-27 21:00:26 +00:00
|
|
|
struct ModernPalette {
|
|
|
|
KColorScheme active;
|
|
|
|
KColorScheme inactive;
|
|
|
|
};
|
2015-03-31 13:26:42 +00:00
|
|
|
|
2020-05-27 21:00:26 +00:00
|
|
|
std::optional<LegacyPalette> m_legacyPalette;
|
|
|
|
KSharedConfig::Ptr m_colorSchemeConfig;
|
2015-03-31 13:26:42 +00:00
|
|
|
|
2020-05-27 21:00:26 +00:00
|
|
|
ModernPalette m_palette;
|
2015-03-31 13:26:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|