summaryrefslogtreecommitdiff
path: root/src/gui/chatwindow.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-06-03 17:24:53 +0200
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-06-09 17:55:39 +0000
commitac0b338b3e026d0d05a447894de9a6a994da82dc (patch)
tree168e0004f0e54cb2fc480485580cd55a46ee3fb5 /src/gui/chatwindow.cpp
parentcdf986b813d267b1d31a28400c0ee38d5e485154 (diff)
downloadmana-ac0b338b3e026d0d05a447894de9a6a994da82dc.tar.gz
mana-ac0b338b3e026d0d05a447894de9a6a994da82dc.tar.bz2
mana-ac0b338b3e026d0d05a447894de9a6a994da82dc.tar.xz
mana-ac0b338b3e026d0d05a447894de9a6a994da82dc.zip
Enable resizing windows from all sides
Previously, the top edge of windows could not be dragged. Now you can also resize windows by their top edge, as well as the top-left and top-right corners.
Diffstat (limited to 'src/gui/chatwindow.cpp')
-rw-r--r--src/gui/chatwindow.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp
index a3d9a1f4..0229bf76 100644
--- a/src/gui/chatwindow.cpp
+++ b/src/gui/chatwindow.cpp
@@ -343,10 +343,17 @@ void ChatWindow::mousePressed(gcn::MouseEvent &event)
if (event.isConsumed())
return;
- mMoved = event.getY() <= getFocused()->getHeight();
- mDragOffsetX = event.getX();
- mDragOffsetY = event.getY();
+ // Enable dragging the chat window also in the tab area, since it doesn't
+ // have much of a title bar.
+ if (!mouseResize)
+ {
+ const int dragHeight = getFocused()->getHeight() +
+ static_cast<int>(getTitleBarHeight());
+ mMoved = event.getY() < dragHeight;
+ mDragOffsetX = event.getX();
+ mDragOffsetY = event.getY();
+ }
}
void ChatWindow::mouseDragged(gcn::MouseEvent &event)