summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-06-19 10:10:15 +0200
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-06-19 10:10:15 +0200
commit61d02a395b0ca594640f0fb917d7162a5aba2c37 (patch)
tree7dd6f7f540dda3d89d37bc7e19f3f4d27dd53c85 /src/gui/widgets
parent5da59b807d9840fb23feb42df729bf5e88ee9678 (diff)
parentac0b338b3e026d0d05a447894de9a6a994da82dc (diff)
downloadmana-online-player-list.tar.gz
mana-online-player-list.tar.bz2
mana-online-player-list.tar.xz
mana-online-player-list.zip
Merge branch 'master' into online-player-listonline-player-list
Conflicts: src/net/tmwa/chathandler.cpp
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/window.cpp16
-rw-r--r--src/gui/widgets/window.h4
2 files changed, 15 insertions, 5 deletions
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index e09986d2..25ca7684 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -371,6 +371,8 @@ void Window::mousePressed(gcn::MouseEvent &event)
// Handle window resizing
mouseResize = getResizeHandles(event);
+ if (mouseResize)
+ mMoved = false;
}
}
@@ -405,12 +407,15 @@ void Window::mouseMoved(gcn::MouseEvent &event)
switch (resizeHandles)
{
case BOTTOM | RIGHT:
+ case TOP | LEFT:
gui->setCursorType(Cursor::RESIZE_DOWN_RIGHT);
break;
case BOTTOM | LEFT:
+ case TOP | RIGHT:
gui->setCursorType(Cursor::RESIZE_DOWN_LEFT);
break;
case BOTTOM:
+ case TOP:
gui->setCursorType(Cursor::RESIZE_DOWN);
break;
case RIGHT:
@@ -676,14 +681,17 @@ void Window::adjustPositionAfterResize(int oldScreenWidth, int oldScreenHeight)
int Window::getResizeHandles(gcn::MouseEvent &event)
{
int resizeHandles = 0;
- const int y = event.getY();
- if (mGrip && y > (int) mTitleBarHeight)
+ if (mGrip)
{
const int x = event.getX();
+ const int y = event.getY();
+ const int p = getPadding();
+
+ const bool inPadding = (x < p || x > getWidth() - p) ||
+ (y < p || y > getHeight() - p);
- if (!getChildrenArea().isPointInRect(x, y) &&
- event.getSource() == this)
+ if (inPadding && event.getSource() == this)
{
resizeHandles |= (x > getWidth() - resizeBorderWidth) ? RIGHT :
(x < resizeBorderWidth) ? LEFT : 0;
diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h
index ef529a9f..975de335 100644
--- a/src/gui/widgets/window.h
+++ b/src/gui/widgets/window.h
@@ -349,6 +349,9 @@ class Window : public gcn::Window, gcn::WidgetListener
*/
static int getGuiAlpha();
+ protected:
+ static int mouseResize; /**< Active resize handles */
+
private:
enum ResizeHandles
{
@@ -394,7 +397,6 @@ class Window : public gcn::Window, gcn::WidgetListener
int mDefaultWidth; /**< Default window width */
int mDefaultHeight; /**< Default window height */
- static int mouseResize; /**< Active resize handles */
static int instances; /**< Number of Window instances */
Skin *mSkin; /**< Skin in use by this window */