forked from BesLyric-for-X/BesLyric-for-X
-
Notifications
You must be signed in to change notification settings - Fork 0
/
StackFrame.h
80 lines (59 loc) · 2.31 KB
/
StackFrame.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
#ifndef STACKFRAME_H
#define STACKFRAME_H
#include <QApplication>
#include "BesFramelessWidget.h"
#include "MainWidget.h"
#include "SkinBoxWidget.h"
#include "AddLyricItemWidget.h"
#include "BesTransparentLayer.h"
#include "ThreadLogin.h"
#include "ThreadCheckUpdate.h"
/*
* StackFrame 程序的主控件类,使用 Qstacklayout 布局
* 包含程序的主体功能控件 和 最外层的“悬浮控件”(如皮肤盒等)
*/
class StackFrame : public BesFramelessWidget
{
Q_OBJECT
public:
StackFrame(QApplication* pApplication, QWidget *parent = 0);
~StackFrame();
void initSetting();
void initLayout();
void initConnection();
void initEntity();
void setBorderMain(int border);
signals:
void onFinalSkinNameChanged(QString);
void onFinalBaseColorChanged(QColor);
protected:
void mouseReleaseEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mousePressEvent(QMouseEvent *event);
virtual void resizeEvent(QResizeEvent *event);
public slots:
void SetSkin(QString skinName, bool bFirstInit = false);
void SetSpecialSkin(QString skinName, bool bFirstInit = false); //有一些样式无法实现的效果,放在这里应用
void toggleMaxRestoreStatus(); //切换最大化和恢复2个状态
void toggleSkinBox(); //显示或隐藏皮肤盒
void toggleAddItemWidget(); //显示或隐藏添加列表项控件
bool mousePressFilter(QMouseEvent *event);
bool bringMainToTop(); //将主程序控件提到最前(生效则返回true)
void onUpdateResultFound(CheckUpgradeResult);
public:
bool isMainOnTop; //标记当期主体控件是否在最顶层
MainWidget* mainWidget; //程序的主体功能控件
BesTransparentLayer* transparentLayer; //透明层
SkinBoxWidget* skinBoxWidget; //皮肤盒
AddLyricItemWidget* addItemWidget; //添加列表项的控件
int borderMain; //边框厚度
int addItemWidgetLeft;
int addItemWidgetTop;
QApplication* pApp;
private:
//登录记录
ThreadLogin login;
ThreadCheckUpdate checkUpdate;
void showVersionInfo();
};
#endif // STACKFRAME_H