-
Notifications
You must be signed in to change notification settings - Fork 0
/
qanimatedmainwindowlayout_p.h
93 lines (73 loc) · 2.54 KB
/
qanimatedmainwindowlayout_p.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
#ifndef QANIMATEDMAINWINDOWLAYOUT_P_H
#define QANIMATEDMAINWINDOWLAYOUT_P_H
#include <QObject>
#include "qanimatedmainwindowlayout.h"
#include <QEasingCurve>
class QAnimatedMainWindowLayout;
class QAnimatedMainWindowLayoutPrivate : public QObject
{
Q_OBJECT
public:
explicit QAnimatedMainWindowLayoutPrivate(QAnimatedMainWindowLayout * p);
virtual ~QAnimatedMainWindowLayoutPrivate();
void setGeometry(const QRect & rect);
void deleteAll();
void addItem(QWidget *widget, QAnimatedMainWindowLayout::LayoutAreas area);
void setStrecth(qreal stretch, QAnimatedMainWindowLayout::LayoutAreas area);
void setSpacing(int space);
void setAnimationEnabled(bool enabled);
void setAnimationDuration(uint duration);
void setEasingCurve(const QEasingCurve &easing);
int strecth(QAnimatedMainWindowLayout::LayoutAreas area) const;
qreal percentage(QAnimatedMainWindowLayout::LayoutAreas area) const;
int spacing() const;
bool isAnimationEnabled() const;
const QEasingCurve & easingCurve() const;
int animationDuration();
QLayoutItem *itemAt(int i) const;
QLayoutItem *takeAt(int i);
int count() const;
QSize sizeHint();
QSize minimumSize();
bool isEmpty() const;
void setDirty();
bool isDirty() const;
private slots:
void animationFinished();
private:
friend class QAnimatedMainWindowLayout;
QAnimatedMainWindowLayout * m_public;
struct Wrapper
{
Wrapper(QWidget * w,QAnimatedMainWindowLayout::LayoutAreas a)
{ item = new QWidgetItem(w); area = a;}
~Wrapper()
{ if (item) delete item; }
QWidgetItem * item;
QAnimatedMainWindowLayout::LayoutAreas area;
};
QList<Wrapper*> m_list;
bool m_dirty;
bool m_hintSizeNeedRecalc;
bool m_minimumSizeNeedRecalc;
bool m_animating;
bool m_isAnimationEnabled;
qreal m_stretch[QAnimatedMainWindowLayout::LayoutAreasMax];
int m_spacing;
uint m_duration;
QEasingCurve m_easingCurves;
QSize m_hintSizeCache;
QSize m_minimumSizeCache;
Wrapper * wrapperAt(
QAnimatedMainWindowLayout::LayoutAreas area,
QList<Wrapper*> list) const;
QSize calcSize(int * w, int * h, size_t sz) const;
QRect geometryOf(
QAnimatedMainWindowLayout::LayoutAreas area,
const QRect &rect,
int *stretch,
qreal *realStretch);
void setupPropertyAnimation(
qreal newStretch, QAnimatedMainWindowLayout::LayoutAreas area);
};
#endif // QANIMATEDMAINWINDOWLAYOUT_P_H