summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-02-01 10:15:29 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-09-28 08:48:07 +0100
commitd2c9f39b7dffce9dfabe8ee53d94863738fd68c0 (patch)
tree6a8aab6a8be67f2e4e4750f1d69cffddcf1ba390
parent60605e36abb0600c61a4129123f2c8ec00122cf4 (diff)
set sane-ish maximum dialog size
todo, extract and refactor the duplicate "holy product mangement" values and reuse those based on screensize
-rw-r--r--vcl/source/window/dialog.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 70105e6a7c4d..ec8ee7289583 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -969,12 +969,16 @@ bool Dialog::isLayoutEnabled() const
Size Dialog::GetOptimalSize(WindowSizeType eType) const
{
- if (eType == WINDOWSIZE_MAXIMUM)
+ if (!isLayoutEnabled())
return SystemWindow::GetOptimalSize(eType);
- Size aSize;
- if (isLayoutEnabled())
- aSize = GetChild(0)->GetOptimalSize(eType);
- return Window::CalcWindowSize(aSize);
+
+ Size aMax(785, 630); //holy product management, TODO
+ if (eType == WINDOWSIZE_MAXIMUM)
+ return aMax;
+
+ Size aSize = GetChild(0)->GetOptimalSize(eType);
+ aSize = Window::CalcWindowSize(aSize);
+ return Size(std::min(aMax.Width(), aSize.Width()), std::min(aMax.Height(), aSize.Height()));
}
void Dialog::Resize()