-
Notifications
You must be signed in to change notification settings - Fork 1
/
sidebarwidget.h
48 lines (38 loc) · 1.04 KB
/
sidebarwidget.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
#ifndef SIDEBARWIDGET_H
#define SIDEBARWIDGET_H
#include <QWidget>
#include <QSystemTrayIcon>
#include "launchbutton.h"
class QPushButton;
class QPropertyAnimation;
class SidebarWidget : public QWidget
{
Q_OBJECT
public:
explicit SidebarWidget(const int desktopWidth, const int desktopHeight, QWidget *parent = 0);
~SidebarWidget();
public slots:
void onMouseMoved();
void openSettingsDialog();
protected:
void mouseMoveEvent(QMouseEvent* /*event*/);
private:
void initTrayIcon();
QPushButton* m_closeButton;
QPushButton* m_optionsButton;
QList<LaunchButton*> m_launchButtons;
QPropertyAnimation *m_animation;
bool m_isMoving;
const int m_desktopWidth;
const int m_desktopHeight;
QTimer *m_animationTimer;
QAction *m_optionsAction;
QAction *m_quitAction;
QSystemTrayIcon *m_trayIcon;
QMenu *m_trayIconMenu;
private slots:
void closeButtonClicked();
void hideWidget();
void iconActivated(QSystemTrayIcon::ActivationReason reason);
};
#endif // SIDEBARWIDGET_H