[Libreoffice-commits] core.git: vcl/source
Caolán McNamara
caolanm at redhat.com
Tue Jul 9 06:46:52 PDT 2013
vcl/source/control/field.cxx | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
New commits:
commit c7e7160fa7d2afe6db1c11e200949d83f7187c36
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jul 9 14:45:47 2013 +0100
Calc optimal size of *dropdown* metricboxes similar to normal dropdowns
Change-Id: I6f79594cb01d9577c66ec5897459c37513cd35f3
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index bf81a41..2a4a30a 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -1005,7 +1005,16 @@ NumericBox::NumericBox( Window* pParent, const ResId& rResId ) :
Size NumericBox::CalcMinimumSize() const
{
- return calcMinimumSize(*this, *this);
+ Size aRet(calcMinimumSize(*this, *this));
+
+ if (IsDropDownBox())
+ {
+ Size aComboSugg(ComboBox::CalcMinimumSize());
+ aRet.Width() = std::max(aRet.Width(), aComboSugg.Width());
+ aRet.Height() = std::max(aRet.Height(), aComboSugg.Height());
+ }
+
+ return aRet;
}
// -----------------------------------------------------------------------
@@ -1948,7 +1957,16 @@ MetricBox::MetricBox( Window* pParent, const ResId& rResId ) :
Size MetricBox::CalcMinimumSize() const
{
- return calcMinimumSize(*this, *this);
+ Size aRet(calcMinimumSize(*this, *this));
+
+ if (IsDropDownBox())
+ {
+ Size aComboSugg(ComboBox::CalcMinimumSize());
+ aRet.Width() = std::max(aRet.Width(), aComboSugg.Width());
+ aRet.Height() = std::max(aRet.Height(), aComboSugg.Height());
+ }
+
+ return aRet;
}
// -----------------------------------------------------------------------
More information about the Libreoffice-commits
mailing list