-
Notifications
You must be signed in to change notification settings - Fork 0
/
decoration.hpp
41 lines (34 loc) · 1006 Bytes
/
decoration.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
#include <KConfigWatcher>
#include <KDecoration2/Decoration>
namespace Arstotzka {
class Decoration : public KDecoration2::Decoration {
Q_OBJECT
public:
// clang-format off
explicit Decoration(QObject *parent = nullptr, const QVariantList &args = QVariantList());
// clang-format on
/**
* Provides the rendering.
*
* The painter is set up to paint on an internal QPaintDevice. The painting is
* implicitly double buffered.
*/
void paint(QPainter *painter, const QRect &repaintRegion) override;
public Q_SLOTS:
/**
* This method gets invoked once the Decoration is created and completely setup.
*
* All initialization must be performed in this method instead of the constructor.
*/
bool init() override;
private:
void updateColors();
void setBorderSizes();
void changeActive();
void connectEvents();
QColor activeColor;
QColor inactiveColor;
KConfigWatcher::Ptr configWatcher;
};
}