forked from N1coc4colA/DA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdaddonsplittedwindow.h
163 lines (135 loc) · 3.96 KB
/
daddonsplittedwindow.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#ifndef DAddonSplittedWINDOW_H
#define DAddonSplittedWINDOW_H
#include "libda_global.h"
#include <DBlurEffectWidget>
LDA_BEGIN_NAMESPACE
DWIDGET_USE_NAMESPACE
/**
* @brief Class that provides modern Ui with splited (left/right) window.
*/
class DAddonSplittedBar;
class LIBDA_SHARED_EXPORT DAddonSplittedWindow : public QWidget
{
Q_OBJECT
public:
explicit DAddonSplittedWindow(QWidget *parent = nullptr, bool leftBlurEnabled = true, DBlurEffectWidget::BlendMode blendMode = DBlurEffectWidget::BlendMode::BehindWindowBlend);
DAddonSplittedWindow();
~DAddonSplittedWindow();
/**
* @brief Widget displayed IN the blur area
* @return The widget being used
*/
QWidget *leftWidget() const;
/**
* @brief Widget on the right
* @return The widget being used
*/
QWidget *rightWidget() const;
/**
* @brief Widget at the bottom of the right widget (top of)
* @return The widget being used
*/
QWidget *bottomWidget() const;
/**
* @brief The win's splitted bar
* @return DSplittedBar being used
*/
DAddonSplittedBar *splitedbar() const;
/**
* @brief Width of the right area
* @return Width currently used
*/
int leftAreaWidth();
/**
* @brief To know if the right side widget fills to the top, including the titlebar (goes behind it)
* @return
*/
bool isEnabledTopFill();
/**
* @brief To know if the right side widget fills to the bottom, including the bottom widget space (behind it)
* @return
*/
bool isEnabledBottomFill();
public Q_SLOTS:
/**
* @brief Have the left widget container use BehindWin blur
* @param Left blur state
*/
void setLeftBlur(bool leftBlur);
/**
* @brief Left container blur mode (DBlurEffectWidget)
*/
void setLeftBlurMode(DBlurEffectWidget::BlurMode);
/**
* @brief setLeftBlendMode
*/
void setLeftBlendMode(DBlurEffectWidget::BlendMode);
/**
* @brief Left container blur color (DBlurEffectWidget)
* @param color
*/
void setLeftBlurColor(QColor color);
/**
* @brief Use the widget w as right widget side
* @param w
*/
void setRightWidget(QWidget *w);
/**
* @brief Use the bottom widget you want on the right side widget (on top)
* @param w
*/
void setBottomWidget(QWidget *w);
/**
* @brief Use custom width for the right side area
* @param width
*/
void setLeftAreaWidth(int width);
/**
* @brief Force use of fullscreen, even if the user won't
* @param force
*/
void enableForceFullScreen(bool force);
/**
* @brief Set if the window have to be shown in fullscreen or not
* @param full
*/
void setFullScreen(bool full);
/**
* @brief Fill the area behind the title bar with the right side widget
* @param enable
*/
void setFillTop(bool enable = true);
/**
* @brief Fill the area behind the bottom widget with the right side widget or don't
* @param enable
*/
void setFillBottom(bool enable = true);
/**
* @brief Use it only if you want to use special things not handled normally, or to replace the current window!
* @param bar
*/
void setTitleBar(DAddonSplittedBar *bar);
/**
* @brief Calculates and moves widgets to their right places
*/
void updatePositions();
/**
* @brief Switch from non full screen (so Maximized and lower) to full and conversly
*/
void switchFullScreen();
protected:
bool eventFilter(QObject *obj, QEvent *ev) override;
void resizeEvent(QResizeEvent *e) override;
private:
DAddonSplittedBar *m_bar;
DBlurEffectWidget *m_leftw = nullptr;
QWidget *m_bottomw = nullptr;
QWidget *m_rightw = nullptr;
bool isOriginal = true;
bool forceFullScreen = false;
bool fillBottom = false;
bool fillTop = false;
int m_leftwidth = 250;
};
LDA_END_NAMESPACE
#endif // DAddonSplittedWINDOW_H