forked from sonichy/dde-dock-cmud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmduwidget.h
50 lines (40 loc) · 1.03 KB
/
cmduwidget.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
#ifndef CMDUWIDGET_H
#define CMDUWIDGET_H
#include <QWidget>
#include <QSettings>
class CMDUWidget : public QWidget
{
Q_OBJECT
public:
explicit CMDUWidget(QWidget *parent = 0);
//bool is24HourFormat() const { return m_24HourFormat; }
bool enabled();
void setEnabled(const bool b);
QString text;
void setCPUPercent(int cpupercent);
void setMemPercent(int mempercent);
void enterEvent(QEvent *event);
void leaveEvent(QEvent *event);
bool getMouseEnter();
signals:
void requestUpdateGeometry() const;
void requestContextMenu() const;
public slots:
//void toggleHourFormat();
private:
QSize sizeHint() const;
void resizeEvent(QResizeEvent *e);
void paintEvent(QPaintEvent *e);
void mousePressEvent(QMouseEvent *e);
QPixmap m_cachedIcon;
QString m_cachedTime;
QSettings m_settings;
bool m_24HourFormat;
QFont font;
QString m_textup;
QString m_textdown;
int m_cpupercent;
int m_mempercent;
bool m_mouseenter;
};
#endif // CMDUWIDGET_H