diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-07-11 00:26:20 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-07-11 00:26:20 +0000 |
commit | 8dd7eef0402cc6e22642f045e3cfde7f5b011d5b (patch) | |
tree | ee5e74923122e5412cd1e1c0dd410e1f3b687dd3 | |
parent | 502c76be8587c1138f4939411be77830619f64d2 (diff) | |
download | mana-client-8dd7eef0402cc6e22642f045e3cfde7f5b011d5b.tar.gz mana-client-8dd7eef0402cc6e22642f045e3cfde7f5b011d5b.tar.bz2 mana-client-8dd7eef0402cc6e22642f045e3cfde7f5b011d5b.tar.xz mana-client-8dd7eef0402cc6e22642f045e3cfde7f5b011d5b.zip |
Fixed resizing windows by their resize grip.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/gui/window.cpp | 13 |
2 files changed, 11 insertions, 8 deletions
@@ -1,4 +1,8 @@ -2007-07-07 Bjørn Lindeijer <bjorn@lindeijer.nl> +2007-07-11 Bjørn Lindeijer <bjorn@lindeijer.nl> + + * src/gui/window.cpp: Fixed resizing windows by their resize grip. + +2007-07-07 Bjørn Lindeijer <bjorn@lindeijer.nl> * src/gui/gui.cpp, src/gui/chatinput.h, src/gui/chatinput.cpp, INSTALL: Ported to Guichan 0.7.0. Unfortunately, since Guichan 0.6.x diff --git a/src/gui/window.cpp b/src/gui/window.cpp index 6165ce70..9f9ce9fc 100644 --- a/src/gui/window.cpp +++ b/src/gui/window.cpp @@ -339,10 +339,11 @@ void Window::mousePressed(gcn::MouseEvent &event) mMouseResize |= (y > getHeight() - resizeBorderWidth) ? BOTTOM : (y < resizeBorderWidth) ? TOP : 0; } - else if (event.getSource() == mGrip) + else if (event.getSource() == mGrip && + event.getButton() == gcn::MouseEvent::LEFT) { - mDragOffsetX = x + mGrip->getX(); - mDragOffsetY = y + mGrip->getY(); + mDragOffsetX = x; + mDragOffsetY = y; mMouseResize |= BOTTOM | RIGHT; mIsMoving = false; } @@ -365,10 +366,8 @@ void Window::mouseDragged(gcn::MouseEvent &event) if (mMouseResize && !mIsMoving) { - const int dx = event.getX() - mDragOffsetX + - ((event.getSource() == mGrip) ? mGrip->getX() : 0); - const int dy = event.getY() - mDragOffsetY + - ((event.getSource() == mGrip) ? mGrip->getY() : 0); + const int dx = event.getX() - mDragOffsetX; + const int dy = event.getY() - mDragOffsetY; gcn::Rectangle newDim = getDimension(); if (mMouseResize & (TOP | BOTTOM)) |