diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-03-25 09:34:46 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-03-25 09:34:46 +0000 |
commit | 65e0fddb81e1e463591b7c189b252ffa75ebda06 (patch) | |
tree | 74c0008c7a2106e910fc6bf7649275ed0b8015e9 /src/gui/window.cpp | |
parent | 5464cbf23ce244f7ccb1741692971dd61a54b005 (diff) | |
download | mana-65e0fddb81e1e463591b7c189b252ffa75ebda06.tar.gz mana-65e0fddb81e1e463591b7c189b252ffa75ebda06.tar.bz2 mana-65e0fddb81e1e463591b7c189b252ffa75ebda06.tar.xz mana-65e0fddb81e1e463591b7c189b252ffa75ebda06.zip |
Added window resize patch by peoro.
Diffstat (limited to 'src/gui/window.cpp')
-rw-r--r-- | src/gui/window.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
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 |