Changeset View
Changeset View
Standalone View
Standalone View
kstyle/breezetoolsareamanager.h
- This file was added.
1 | #ifndef breezetoolsareamanager_h | ||||
---|---|---|---|---|---|
2 | #define breezetoolsareamanager_h | ||||
3 | | ||||
4 | #include <QObject> | ||||
5 | #include <QVariantAnimation> | ||||
6 | #include "breezestyle.h" | ||||
7 | #include "breezehelper.h" | ||||
8 | | ||||
9 | namespace Breeze { | ||||
10 | struct ToolsAreaAnimation { | ||||
11 | QPointer<QVariantAnimation> foregroundColorAnimation; | ||||
12 | QPointer<QVariantAnimation> backgroundColorAnimation; | ||||
13 | bool prevActive; | ||||
14 | }; | ||||
15 | class ToolsAreaManager: public QObject | ||||
16 | { | ||||
17 | Q_OBJECT | ||||
18 | | ||||
19 | public: | ||||
20 | explicit ToolsAreaManager(Helper* helper, QObject *parent = nullptr); | ||||
21 | ~ToolsAreaManager(); | ||||
22 | void registerWidget(QWidget *widget); | ||||
23 | void unregisterWidget(QWidget *widget); | ||||
24 | void updateAnimations(); | ||||
25 | | ||||
26 | QColor foreground(const QWidget *widget); | ||||
27 | QColor background(const QWidget *widget); | ||||
28 | | ||||
29 | bool widgetHasCorrectPaletteSet(const QWidget *widget); | ||||
30 | | ||||
31 | Q_SIGNALS: | ||||
32 | void toolbarUpdated(); | ||||
33 | | ||||
34 | private: | ||||
35 | void registerWindow ( QWindow *window ); | ||||
36 | void registerAnimation( QWidget *widget ); | ||||
37 | bool animationRunning( const QWidget *widget ); | ||||
38 | QSet<QWidget*> _registeredWidgets; | ||||
39 | QSet<QWindow*> _registeredWindows; | ||||
40 | Helper* _helper; | ||||
41 | | ||||
42 | QMap<QWindow*,ToolsAreaAnimation> animationMap; | ||||
43 | }; | ||||
44 | } | ||||
45 | | ||||
46 | #endif |