-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSlidePage.h
48 lines (39 loc) · 1.07 KB
/
SlidePage.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
#pragma once
#include <QLabel>
#include <QVBoxLayout>
#include "CustomIcon.h"
#include "SheildLayer.h"
#include "ScrollAreaCustom.h"
class SlidePage : public QWidget
{
Q_OBJECT
private:
int cornerRadius;
QString pageName;
ScrollAreaCustom* pageContentContainer;
QLabel* nameLabel;
CustomIcon* backIcon;
SheildLayer* sheildLayer;
QWidget* bgWidget;
QFont textFont = QFont("Corbel Light", 24);
bool onShown = false;
QParallelAnimationGroup* curAni = nullptr;
QGraphicsOpacityEffect* opacity;
void resizeEvent(QResizeEvent* event);
public:
const int preferWidth = 350;
explicit SlidePage(int radius, QString name, QWidget* parent = nullptr);
void SetRadius(int radius);
void SetName(QString name);
void AddContent(QWidget* widget);
void AddContents(QVector<QWidget*> widgets);
void RemoveContent(QWidget* widget);
void RemoveContents(QVector<QWidget*> widgets);
void UpdateContents();
void ScrollToTop();
signals:
void sizeChange();
public slots:
void slideIn();
void slideOut();
};