From 65e0fddb81e1e463591b7c189b252ffa75ebda06 Mon Sep 17 00:00:00 2001 From: Eugenio Favalli Date: Sat, 25 Mar 2006 09:34:46 +0000 Subject: Added window resize patch by peoro. --- src/gui/window.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/gui/window.cpp') diff --git a/src/gui/window.cpp b/src/gui/window.cpp index 492fe292..974a1d73 100644 --- a/src/gui/window.cpp +++ b/src/gui/window.cpp @@ -63,8 +63,8 @@ Window::Window(const std::string& caption, bool modal, Window *parent): mModal(modal), mResizable(false), mMouseResize(false), - mMinWinWidth(6), - mMinWinHeight(23), + mMinWinWidth(100), + mMinWinHeight(28), mMaxWinWidth(INT_MAX), mMaxWinHeight(INT_MAX) { @@ -341,25 +341,22 @@ void Window::mouseMotion(int x, int y) } // Keep the window at least its minimum size - int Xcorrection = 0; - int Ycorrection = 0; - if (newDim.width < mMinWinWidth) { - Xcorrection = mMinWinWidth - newDim.width; + newDim.width = mMinWinWidth; } else if (newDim.width > mMaxWinWidth) { - Xcorrection = mMaxWinWidth - newDim.width; + newDim.width = mMaxWinWidth; } if (newDim.height < mMinWinHeight) { - Ycorrection = mMinWinHeight - newDim.height; + newDim.height = mMinWinHeight; } else if (newDim.height > mMaxWinHeight) { - Ycorrection = mMaxWinHeight - newDim.height; + newDim.height = mMaxWinHeight; } // Snap window to edges -- cgit v1.2.3-70-g09d2