diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-03-21 17:32:27 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-03-21 18:51:45 +0300 |
commit | 3ed0b5f6edce152fa2eca9c84d64cbeec8ac0173 (patch) | |
tree | 8791e88608a737b0cb56997743a1404f982eecc8 /src/gui/widgets/scrollarea.cpp | |
parent | 1dd71a1f8489b35d1c989fb0477122224d981853 (diff) | |
download | ManaVerse-3ed0b5f6edce152fa2eca9c84d64cbeec8ac0173.tar.gz ManaVerse-3ed0b5f6edce152fa2eca9c84d64cbeec8ac0173.tar.bz2 ManaVerse-3ed0b5f6edce152fa2eca9c84d64cbeec8ac0173.tar.xz ManaVerse-3ed0b5f6edce152fa2eca9c84d64cbeec8ac0173.zip |
Add consume calls into mouse press / click handlers.
Diffstat (limited to 'src/gui/widgets/scrollarea.cpp')
-rw-r--r-- | src/gui/widgets/scrollarea.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index 571297ace..4aeef8efb 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -739,24 +739,28 @@ void ScrollArea::mousePressed(MouseEvent& event) setVerticalScrollAmount(mVScroll - mUpButtonScrollAmount); mUpButtonPressed = true; + event.consume(); } else if (getDownButtonDimension().isPointInRect(x, y)) { setVerticalScrollAmount(mVScroll + mDownButtonScrollAmount); mDownButtonPressed = true; + event.consume(); } else if (getLeftButtonDimension().isPointInRect(x, y)) { setHorizontalScrollAmount(mHScroll - mLeftButtonScrollAmount); mLeftButtonPressed = true; + event.consume(); } else if (getRightButtonDimension().isPointInRect(x, y)) { setHorizontalScrollAmount(mHScroll + mRightButtonScrollAmount); mRightButtonPressed = true; + event.consume(); } else if (getVerticalMarkerDimension().isPointInRect(x, y)) { @@ -764,6 +768,7 @@ void ScrollArea::mousePressed(MouseEvent& event) mIsVerticalMarkerDragged = true; mVerticalMarkerDragOffset = y - getVerticalMarkerDimension().y; + event.consume(); } else if (getVerticalBarDimension().isPointInRect(x, y)) { @@ -777,13 +782,14 @@ void ScrollArea::mousePressed(MouseEvent& event) setVerticalScrollAmount(mVScroll + static_cast<int>(getChildrenArea().height * 0.95)); } + event.consume(); } else if (getHorizontalMarkerDimension().isPointInRect(x, y)) { mIsHorizontalMarkerDragged = true; mIsVerticalMarkerDragged = false; - mHorizontalMarkerDragOffset = x - getHorizontalMarkerDimension().x; + event.consume(); } else if (getHorizontalBarDimension().isPointInRect(x, y)) { @@ -797,6 +803,7 @@ void ScrollArea::mousePressed(MouseEvent& event) setHorizontalScrollAmount(mHScroll + static_cast<int>(getChildrenArea().width * 0.95)); } + event.consume(); } if (event.getButton() == MouseEvent::LEFT) |