-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdsplitedwindow.h
111 lines (96 loc) · 2.52 KB
/
dsplitedwindow.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
#ifndef DSPLITEDWINDOW_H
#define DSPLITEDWINDOW_H
#include "libda_global.h"
#include <DBlurEffectWidget>
LDA_BEGIN_NAMESPACE
DWIDGET_USE_NAMESPACE
class DSplitedBar;
/**
* @brief Class that provides modern Ui with splited (left/right) window.
*/
class LIBDA_SHARED_EXPORT DSplitedWindow : public QWidget
{
Q_OBJECT
public:
explicit DSplitedWindow(QWidget *parent = nullptr, bool leftBlurEnabled = true, DBlurEffectWidget::BlendMode blendMode = DBlurEffectWidget::BlendMode::BehindWindowBlend);
/**
* @brief Widget used on the left side
* @return
*/
QWidget *leftWidget() const;
/**
* @brief Widget used on the right side
* @return
*/
QWidget *rightWidget() const;
/**
* @brief Widget at the bottom of the right side
* @return
*/
QWidget *bottomWidget() const;
/**
* @brief DSplittedBar used in this window
* @return
*/
DSplitedBar *splitedbar() const;
void setLeftBlur(bool leftBlur);
/**
* @brief set blur mode of the left DBlurEffectWidget
*/
void setLeftBlurMode(DBlurEffectWidget::BlurMode);
/**
* @brief set blend mode of the left DBlurEffectWidget
*/
void setLeftBlendMode(DBlurEffectWidget::BlendMode);
/**
* @brief Blur color of the left side
* @param color
*/
void setLeftBlurColor(QColor color);
/**
* @brief Choose the widget to use at the right side
* @param w
*/
void setRightWidget(QWidget *w);
/**
* @brief Add a widget at the bottom of the right area
* @param w
*/
void setBottomWidget(QWidget *w);
/**
* @brief Change the left area size
* @param width
*/
void setLeftAreaWidth(int width);
/**
* @brief Width of the left area, adapted with the splitted bar's too
* @return
*/
int leftAreaWidth();
/**
* @brief Toggle Fullscreen mode
*/
void switchFullScreen();
/**
* @brief Enforce fullscreen, if user wants to resize it or any, impossible!
* @param force
*/
void enableForceFullScreen(bool force);
/**
* @brief Enable fullscreen mode or don't
* @param full
*/
void setFullScreen(bool full);
protected:
void resizeEvent(QResizeEvent *e) override;
private:
DSplitedBar *m_bar;
DBlurEffectWidget *m_leftw = nullptr;
QWidget *m_bottomw = nullptr;
QWidget *m_rightw = nullptr;
bool isOriginal = true;
bool forceFullScreen = false;
int m_leftwidth = 250;
};
LDA_END_NAMESPACE
#endif // DSPLITEDWINDOW_H