aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickpopup_p_p.h
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-09-06 09:21:15 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-09-06 15:20:10 +0000
commit9ae57848671419b2622e254af8642fef7b1b7c33 (patch)
treed25df980ee418ecd2fe09312873b42ab8691f677 /src/quicktemplates2/qquickpopup_p_p.h
parentbc0fdae8fad4e199792b3f00ebcb74bd80473227 (diff)
QQuickDrawer: fix the internal transition state
When QQuickDrawer was visible all the time, it did not emit the visibility related signals at all. Now the signals are emitted, but aboutToShow() and visibleChanged() were emitted twice when a drawer was manually dragged open. First time when the dragging begins (the drawer becomes effectively visible), and second time when the open transition begins after mouse/touch release. This change ensures that the signals won't be emitted again when the transition begins, in case they were already emitted. Change-Id: I2a175c9e86a480d5cd23e306f41f0d85e2416f75 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickpopup_p_p.h')
-rw-r--r--src/quicktemplates2/qquickpopup_p_p.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/quicktemplates2/qquickpopup_p_p.h b/src/quicktemplates2/qquickpopup_p_p.h
index 80cb8522..b828edc1 100644
--- a/src/quicktemplates2/qquickpopup_p_p.h
+++ b/src/quicktemplates2/qquickpopup_p_p.h
@@ -76,11 +76,6 @@ protected:
void finished() override;
private:
- enum TransitionState {
- Off, Enter, Exit
- };
-
- TransitionState state;
QQuickPopupPrivate *popup;
};
@@ -163,10 +158,10 @@ public:
bool tryClose(QQuickItem *item, QMouseEvent *event);
virtual void reposition();
- virtual void prepareEnterTransition(bool notify = true);
- virtual void prepareExitTransition();
+ virtual bool prepareEnterTransition();
+ virtual bool prepareExitTransition();
virtual void finalizeEnterTransition();
- virtual void finalizeExitTransition(bool hide = true);
+ virtual void finalizeExitTransition();
QMarginsF getMargins() const;
@@ -178,6 +173,10 @@ public:
void setWindow(QQuickWindow *window);
void itemDestroyed(QQuickItem *item) override;
+ enum TransitionState {
+ NoTransition, EnterTransition, ExitTransition
+ };
+
bool focus;
bool modal;
bool dim;
@@ -202,6 +201,7 @@ public:
qreal bottomMargin;
qreal contentWidth;
qreal contentHeight;
+ TransitionState transitionState;
QQuickPopup::ClosePolicy closePolicy;
QQuickItem *parentItem;
QQuickItem *dimmer;