diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-08-26 11:49:42 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-08-26 12:11:33 (GMT) |
commit | b5f00cdc0a63ea598d7af908240f0de5ac141262 (patch) | |
tree | 6b531bf6f5901ae4e628d0075e22d328d4bfccd9 /src/gui/widgets | |
parent | e9ffb5b0918e800edfba6b697c7a14ef6c7fa8e1 (diff) | |
download | Qt-b5f00cdc0a63ea598d7af908240f0de5ac141262.zip Qt-b5f00cdc0a63ea598d7af908240f0de5ac141262.tar.gz Qt-b5f00cdc0a63ea598d7af908240f0de5ac141262.tar.bz2 |
QToolbar now collapses when dragged
Previously it wouldn't and the layout could appear to be broken.
Task-number: 248817
Reviewed-by: Gabriel De Dietrich
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qtoolbar.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/qtoolbarlayout.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/qtoolbarlayout_p.h | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/widgets/qtoolbar.cpp b/src/gui/widgets/qtoolbar.cpp index bf44ea1..89e6d7a 100644 --- a/src/gui/widgets/qtoolbar.cpp +++ b/src/gui/widgets/qtoolbar.cpp @@ -391,7 +391,7 @@ bool QToolBarPrivate::mouseMoveEvent(QMouseEvent *event) void QToolBarPrivate::unplug(const QRect &_r) { Q_Q(QToolBar); - + layout->setExpanded(false, false); QRect r = _r; r.moveTopLeft(q->mapToGlobal(QPoint(0, 0))); setWindowState(true, true, r); diff --git a/src/gui/widgets/qtoolbarlayout.cpp b/src/gui/widgets/qtoolbarlayout.cpp index d3c5b4b..1f2ca60 100644 --- a/src/gui/widgets/qtoolbarlayout.cpp +++ b/src/gui/widgets/qtoolbarlayout.cpp @@ -642,7 +642,7 @@ QSize QToolBarLayout::expandedSize(const QSize &size) const return result; } -void QToolBarLayout::setExpanded(bool exp) +void QToolBarLayout::setExpanded(bool exp, bool animated) { if (exp == expanded) return; @@ -665,7 +665,7 @@ void QToolBarLayout::setExpanded(bool exp) layoutActions(rect.size()); } } - layout->layoutState.toolBarAreaLayout.apply(true); + layout->layoutState.toolBarAreaLayout.apply(animated); } } diff --git a/src/gui/widgets/qtoolbarlayout_p.h b/src/gui/widgets/qtoolbarlayout_p.h index fe81d2f..bb40e215 100644 --- a/src/gui/widgets/qtoolbarlayout_p.h +++ b/src/gui/widgets/qtoolbarlayout_p.h @@ -111,8 +111,8 @@ public: void updateMarginAndSpacing(); bool hasExpandFlag() const; -public slots: - void setExpanded(bool b); +public Q_SLOTS: + void setExpanded(bool b, bool animated = true); private: QList<QToolBarItem*> items; |