-
Notifications
You must be signed in to change notification settings - Fork 3
/
windowtitle.h
52 lines (40 loc) · 948 Bytes
/
windowtitle.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
#ifndef WINDOWTITLE_H
#define WINDOWTITLE_H
#include<QHBoxLayout>
#include <QCoreApplication>
#include <QWidget>
#include <QFrame>
#include <QPixmap>
#include <QPainter>
#include <QLabel>
#include <QMouseEvent>
#include <QPushButton>
class WindowTitle : public QFrame
{
Q_OBJECT
public:
explicit WindowTitle(QWidget * parent = 0);
~WindowTitle();
signals:
public slots:
void UpdateWindowTitle();
protected slots:
void Minimized ();
void Maximized ();
void Quit ();
protected:
void mousePressEvent(QMouseEvent * event = 0);
void mouseReleaseEvent(QMouseEvent * event = 0);
void mouseMoveEvent(QMouseEvent * event = 0);
private:
QLabel title;
QGridLayout titleLayout;
QHBoxLayout buttonsLayout;
QHBoxLayout labelLayout;
QLabel icon;
QPushButton maximizeButton;
QPushButton minimizeButton;
QPushButton closeButton;
QPoint mousePosition;
};
#endif // WINDOWTITLE_H