kwin/decorations/decorationpalette.h
Mika Allan Rauhala 3389c7569f Adapt to KDecoration API changes
Adapt to API changes introduced by b62e8888cd39301e00ad98dfe791fa66676408fb.
It adds DecoratedClient::color(group, role) for getting colors that are
not included in QPalette. Breeze used to read these colors from
kdeglobals, breaking per window color schemes. KWin now handles reading
these colors along with QPalette loading with DecorationPalette.

REVIEW: 122883
2015-03-31 15:26:55 +02:00

70 lines
1.8 KiB
C++

/********************************************************************
KWin - the KDE window manager
This file is part of the KDE project.
Copyright 2014 Martin Gräßlin <mgraesslin@kde.org>
Copyright 2014 Hugo Pereira Da Costa <hugo.pereira@free.fr>
Copyright 2015 Mika Allan Rauhala <mika.allan.rauhala@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
#ifndef KWIN_DECORATION_PALETTE_H
#define KWIN_DECORATION_PALETTE_H
#include <KDecoration2/DecorationSettings>
#include <QFileSystemWatcher>
#include <QPalette>
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;
QFileSystemWatcher m_watcher;
QPalette m_palette;
QColor m_activeTitleBarColor;
QColor m_inactiveTitleBarColor;
QColor m_activeFrameColor;
QColor m_inactiveFrameColor;
QColor m_activeForegroundColor;
QColor m_inactiveForegroundColor;
QColor m_warningForegroundColor;
};
}
}
#endif