summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qtoolbararealayout.cpp
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-06-11 14:05:28 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-06-11 14:07:04 (GMT)
commite3d6bd3fc41b09c2eb7c56789d7dc5e26722a3b9 (patch)
tree0ec4358353076da231d434a67d9c0d3adf66822f /src/gui/widgets/qtoolbararealayout.cpp
parenta208e75bcdeb4fe39e82d0f86cc2cd72980f40a4 (diff)
downloadQt-e3d6bd3fc41b09c2eb7c56789d7dc5e26722a3b9.zip
Qt-e3d6bd3fc41b09c2eb7c56789d7dc5e26722a3b9.tar.gz
Qt-e3d6bd3fc41b09c2eb7c56789d7dc5e26722a3b9.tar.bz2
Fixed ToolBar layout so that when a toolbar is resized to its sizeHint
we get a "sticky" effect
Diffstat (limited to 'src/gui/widgets/qtoolbararealayout.cpp')
-rw-r--r--src/gui/widgets/qtoolbararealayout.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/widgets/qtoolbararealayout.cpp b/src/gui/widgets/qtoolbararealayout.cpp
index 240d059..b1b743e 100644
--- a/src/gui/widgets/qtoolbararealayout.cpp
+++ b/src/gui/widgets/qtoolbararealayout.cpp
@@ -440,9 +440,10 @@ void QToolBarAreaLayoutInfo::moveToolBar(QToolBar *toolbar, int pos)
//we check if the previous is near its size hint
//in which case we try to stick to it
- if (qAbs(pick(o, previous.sizeHint()) - (previous.size + extra)) < QApplication::startDragDistance()) {
- //we stick to the default space
- extra = 0;
+ const int diff = pick(o, previous.sizeHint()) - (previous.size + extra);
+ if (qAbs(diff) < QApplication::startDragDistance()) {
+ //we stick to the default place and size
+ extra += diff;
}
//update for the current item