-
Notifications
You must be signed in to change notification settings - Fork 0
/
TitleBar.h
52 lines (41 loc) · 865 Bytes
/
TitleBar.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 TITLEBAR_H
#define TITLEBAR_H
#include <QtGui>
#include <QToolButton>
#include <QtWidgets/QLabel>
#include <QtWidgets/QHBoxLayout>
#include <QStyle>
/*!
* @brief Class used to implement a custom TitleBar
*
* Class used to implement a custom TitleBar
*/
class TitleBar : public QWidget
{
Q_OBJECT
public:
TitleBar(QWidget *parent, QWidget *mainw);
void titleChanged();
public slots:
void showSmall();
void showMaxRestore();
protected:
// d&d
void mousePressEvent(QMouseEvent *me);
void mouseMoveEvent(QMouseEvent *me);
private:
QWidget *mainwin;
QLabel *mLabel;
bool mMaxNormal; //!< window maximized or minimized?
// Window buttons
QToolButton *mMinimizeButton;
QToolButton *mMaximizeButton;
QToolButton *mCloseButton;
// Icons
QIcon maxicon;
QIcon resticon;
// d&d
QPoint mStartPos;
QPoint mClickPos;
};
#endif // TITLEBAR_H