diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-04-26 11:49:50 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-09-02 13:37:14 +0200 |
commit | ed589aa6fbe1a763a9132d6d8d9e9e807b423b5e (patch) | |
tree | 929cf5fa79592c641b2958797a6642c443d8705b /src/gui/widgets/window.cpp | |
parent | e2755e28439956cbb3c34adfaa87ae1b083e6029 (diff) | |
download | mana-ed589aa6fbe1a763a9132d6d8d9e9e807b423b5e.tar.gz mana-ed589aa6fbe1a763a9132d6d8d9e9e807b423b5e.tar.bz2 mana-ed589aa6fbe1a763a9132d6d8d9e9e807b423b5e.tar.xz mana-ed589aa6fbe1a763a9132d6d8d9e9e807b423b5e.zip |
Added a hand mouse cursor, used when hovering links
InputEvent::mIsConsumed is used to tell the Window it should not change
the mouse cursor as well.
This change also adds a closed hand mouse cursor, though this is unused
for now (might be useful when dragging stuff around).
The new cursors are by meway.
Diffstat (limited to 'src/gui/widgets/window.cpp')
-rw-r--r-- | src/gui/widgets/window.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 70b6dae8..6231bcbf 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -383,14 +383,9 @@ void Window::close() void Window::mouseReleased(gcn::MouseEvent &event) { - if (mGrip && mouseResize) - { - mouseResize = 0; - gui->setCursorType(Cursor::POINTER); - } + mouseResize = 0; - // This should be the responsibility of Guichan (and is from 0.8.0 on) - mMoved = false; + gcn::Window::mouseReleased(event); } void Window::mouseExited(gcn::MouseEvent &event) @@ -401,6 +396,15 @@ void Window::mouseExited(gcn::MouseEvent &event) void Window::mouseMoved(gcn::MouseEvent &event) { + // Make sure BeingPopup is hidden (Viewport does not receive mouseExited) + if (viewport) + viewport->hideBeingPopup(); + + // Don't change mouse cursor when event was consumed by child widget + // (in this case child widget is responsible for mouse cursor) + if (event.isConsumed()) + return; + int resizeHandles = getResizeHandles(event); // Changes the custom mouse cursor based on it's current position. @@ -425,9 +429,6 @@ void Window::mouseMoved(gcn::MouseEvent &event) default: gui->setCursorType(Cursor::POINTER); } - - if (viewport) - viewport->hideBeingPopup(); } void Window::mouseDragged(gcn::MouseEvent &event) |