kwin/src/decorations/decorationpalette.h
Vlad Zahorodnii 93e0265e4e Move source code to src/ directory
Once in a while, we receive complaints from other fellow KDE developers
about the file organization of kwin. This change addresses some of those
complaints by moving all of source code in a separate directory, src/,
thus making the project structure more traditional. Things such as tests
are kept in their own toplevel directories.

This change may wreak havoc on merge requests that add new files to kwin,
but if a patch modifies an already existing file, git should be smart
enough to figure out that the file has been relocated.

We may potentially split the src/ directory further to make navigating
the source code easier, but hopefully this is good enough already.
2021-02-10 15:31:43 +00:00

76 lines
1.6 KiB
C++

/*
KWin - the KDE window manager
This file is part of the KDE project.
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>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef KWIN_DECORATION_PALETTE_H
#define KWIN_DECORATION_PALETTE_H
#include <KDecoration2/DecorationSettings>
#include <QFileSystemWatcher>
#include <QPalette>
#include <KSharedConfig>
#include <KColorScheme>
#include <KConfigWatcher>
#include <optional>
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;
KConfigWatcher::Ptr m_watcher;
struct LegacyPalette {
QPalette palette;
QColor activeTitleBarColor;
QColor inactiveTitleBarColor;
QColor activeFrameColor;
QColor inactiveFrameColor;
QColor activeForegroundColor;
QColor inactiveForegroundColor;
QColor warningForegroundColor;
};
struct ModernPalette {
KColorScheme active;
KColorScheme inactive;
};
std::optional<LegacyPalette> m_legacyPalette;
KSharedConfig::Ptr m_colorSchemeConfig;
ModernPalette m_palette;
};
}
}
#endif