diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-12-04 16:34:14 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-12-04 16:36:42 (GMT) |
commit | b00b1c660beeb861ed3ce618ee30a3c46c95cfa2 (patch) | |
tree | 979d5069988ff17c0c4f5efcd322de99f6da0283 /src/gui/widgets | |
parent | a5c29dbf012324ac2de2f0aecd7a57b37a499ce9 (diff) | |
download | Qt-b00b1c660beeb861ed3ce618ee30a3c46c95cfa2.zip Qt-b00b1c660beeb861ed3ce618ee30a3c46c95cfa2.tar.gz Qt-b00b1c660beeb861ed3ce618ee30a3c46c95cfa2.tar.bz2 |
Fix toolbar animation when restoring from expanded state
Task-number: QTBUG-6529
Reviewed-by: Gabi
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qtoolbar.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/qtoolbarlayout.cpp | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/widgets/qtoolbar.cpp b/src/gui/widgets/qtoolbar.cpp index 58a3d28..c0ca015 100644 --- a/src/gui/widgets/qtoolbar.cpp +++ b/src/gui/widgets/qtoolbar.cpp @@ -396,10 +396,10 @@ bool QToolBarPrivate::mouseMoveEvent(QMouseEvent *event) void QToolBarPrivate::unplug(const QRect &_r) { Q_Q(QToolBar); - layout->setExpanded(false); QRect r = _r; r.moveTopLeft(q->mapToGlobal(QPoint(0, 0))); setWindowState(true, true, r); + layout->setExpanded(false); } void QToolBarPrivate::plug(const QRect &r) diff --git a/src/gui/widgets/qtoolbarlayout.cpp b/src/gui/widgets/qtoolbarlayout.cpp index 0afe5d8..93429e4 100644 --- a/src/gui/widgets/qtoolbarlayout.cpp +++ b/src/gui/widgets/qtoolbarlayout.cpp @@ -654,6 +654,7 @@ void QToolBarLayout::setExpanded(bool exp) if (!tb) return; if (QMainWindow *win = qobject_cast<QMainWindow*>(tb->parentWidget())) { + animating = !tb->isWindow() && win->isAnimated(); QMainWindowLayout *layout = qobject_cast<QMainWindowLayout*>(win->layout()); if (expanded) { tb->raise(); @@ -664,7 +665,7 @@ void QToolBarLayout::setExpanded(bool exp) layoutActions(rect.size()); } } - layout->layoutState.toolBarAreaLayout.apply(win->isAnimated()); + layout->layoutState.toolBarAreaLayout.apply(animating); } } |