diff options
author | Bertram <bertram@cegetel.net> | 2009-07-31 00:22:55 +0200 |
---|---|---|
committer | Bertram <bertram@cegetel.net> | 2009-07-31 00:22:55 +0200 |
commit | 299f987469192b7c77b4b724875b481a8fa83ced (patch) | |
tree | 5c8963e4ad54eb16044a46a8f454ed967a0c5908 /src/gui | |
parent | ada0e4750e383bb9906153c1eec1e91dda6cf263 (diff) | |
download | mana-299f987469192b7c77b4b724875b481a8fa83ced.tar.gz mana-299f987469192b7c77b4b724875b481a8fa83ced.tar.bz2 mana-299f987469192b7c77b4b724875b481a8fa83ced.tar.xz mana-299f987469192b7c77b4b724875b481a8fa83ced.zip |
Corrected indentation a bit.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/chat.cpp | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 1561002a..fa078983 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -367,33 +367,35 @@ void ChatWindow::scroll(int amount) if (tab) tab->scroll(amount); } + void ChatWindow::mousePressed(gcn::MouseEvent &event) { -Window::mousePressed(event); + Window::mousePressed(event); -if(event.isConsumed()) -return; + if(event.isConsumed()) + return; -mMoved = event.getY() <= mCurrentTab->getHeight(); -mDragOffsetX = event.getX(); -mDragOffsetY = event.getY(); + mMoved = event.getY() <= mCurrentTab->getHeight(); + mDragOffsetX = event.getX(); + mDragOffsetY = event.getY(); } + void ChatWindow::mouseDragged(gcn::MouseEvent &event) { -Window::mouseDragged(event); + Window::mouseDragged(event); -if(event.isConsumed()) -return; + if(event.isConsumed()) + return; -if(isMovable() && mMoved) -{ - int newX = std::max(0, getX() + event.getX() - mDragOffsetX); - int newY = std::max(0, getY() + event.getY() - mDragOffsetY); - newX = std::min(graphics->getWidth() - getWidth(), newX); - newY = std::min(graphics->getHeight() - getHeight(), newY); - setPosition(newX, newY); -} + if(isMovable() && mMoved) + { + int newX = std::max(0, getX() + event.getX() - mDragOffsetX); + int newY = std::max(0, getY() + event.getY() - mDragOffsetY); + newX = std::min(graphics->getWidth() - getWidth(), newX); + newY = std::min(graphics->getHeight() - getHeight(), newY); + setPosition(newX, newY); + } } |