-
Notifications
You must be signed in to change notification settings - Fork 0
/
panel.h
153 lines (121 loc) · 2.97 KB
/
panel.h
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#ifndef PANEL_H
#define PANEL_H
#include "configman.h"
#include <QWidget>
#include <QBoxLayout>
#include <QGuiApplication>
#include <QApplication>
#include <QScreen>
#include <QDBusAbstractAdaptor>
#include <QJsonObject>
#include <QJsonValue>
#include <QJsonArray>
#include <QFile>
#include <QJsonDocument>
#include <QTimer>
#include <QPropertyAnimation>
#include <QGraphicsDropShadowEffect>
#include <QFont>
#include <QPushButton>
#include <QLabel>
#include <QDial>
#include <QBoxLayout>
#include <QGraphicsScene>
#include <QGraphicsTextItem>
#include <QGraphicsView>
#include <QtConcurrent>
#include <KWindowSystem>
#include <QBitmap>
#include <QMouseEvent>
QT_BEGIN_NAMESPACE
namespace Ui { class panel; }
QT_END_NAMESPACE
enum PanelInterference {
None = 0,
TopAndLeft = 1,
TopAndRight = 2,
BottomAndLeft = 3,
BottomAndRight = 4,
LeftAndTop = 5,
LeftAndBottom = 6,
RightAndTop = 7,
RightAndBottom = 8,
Match = 9
};
enum PanelLayout {
Horizontal = 0,
Vertical = 1
};
enum AnimationType {
Show = 1,
Hide = 2,
AutoHide = 3
};
class Panel : public QWidget {
Q_OBJECT
public:
Panel(QObject *parent = nullptr,
ConfigManager* cfgMan = nullptr,
int id = 0,
QApplication* app = nullptr,
QList<Panel*> prevPanels = {});
void animation(AnimationType type);
~Panel();
void setRepeatingActions();
void setPanelFlags();
void setPanelGeometry();
void setOnCenter();
void setPanelUI();
void addApplets();
void setTransparency();
void setAppletsActions();
void autoHideSetup();
void testpoint(QObject* parent);
void highlight();
void enterEvent(QEvent * event) override;
void leaveEvent(QEvent* event) override;
void resizeEvent(QResizeEvent* event) override;
QList<QObject*> mAppletList;
QApplication *mApplication;
ConfigManager* mCfgMan;
WId mPanelWId;
pid_t mPanelPID;
int mPanelID;
QObject* mExecHolder;
QScreen* mPanelScreen = nullptr;
QRect mScreenGeometry;
int mScreenWidth, mScreenHeight;
QList<Panel*> mPrevPanels;
int mPanelThickness;
int mSpacing;
PanelLayout mPanelLayout;
int mPanelWidth, mPanelHeight;
PanelLocation mPanelLocation;
int mAxisShift;
QBoxLayout* mBoxLayout;
QFont mPanelFont;
QFontMetrics* mFontMetrics;
QString mStylesheet;
bool mPanelTransparent = false;
QString mAccentColor;
double mOpacity;
bool mShowDate;
QString mTimeFormat, mDateFormat;
QBoxLayout* mWindowListLayout;
int mLauncherIconSize;
QList<QWidget*>* mMprisCards;
int mIPAngle;
QHash<QString,QObject*> mOtherItems;
qint8 mCountWorkspaces;
QList<QProcess*> mProcesses;
QBoxLayout* mSNILayout;
bool mHasCLIOutputApplet = false;
bool mEnableAutoHide = false;
QTimer* mAutoHideTimer;
bool mAutoHidden = false;
private:
QFrame* mPanelFrame;
signals:
void animationFinished();
};
#endif // PANEL_H