summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-11-13 15:32:19 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-11-13 15:32:19 +0000
commit9723d0c14c90454496b7a05289bd6994e28c0aa5 (patch)
treec4f461c047ed66023623c967570943ede9136f4b /vcl/source
parentc5aa953e005709c113f6ac11b9028e0a551a84eb (diff)
macosx theme has a gap between edit area and up/down area
in spinbuttons, so adding just the width of the up/down buttons will not take into account that intermediate space in determining the optimal size Change-Id: I219a02b3313e87f4c927d52de34eda040b13133e
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/control/spinfld.cxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index ecb0e51bd91f..47aa1974f32d 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -995,7 +995,24 @@ Size SpinField::CalcMinimumSizeForText(const rtl::OUString &rString) const
if ( GetStyle() & WB_DROPDOWN )
aSz.Width() += GetSettings().GetStyleSettings().GetScrollBarSize();
if ( GetStyle() & WB_SPIN )
- aSz.Width() += maUpperRect.GetWidth();
+ {
+ ImplControlValue aControlValue;
+ Rectangle aArea( Point(), Size(100, aSz.Height()));
+ Rectangle aEntireBound, aEntireContent, aEditBound, aEditContent;
+ if (
+ GetNativeControlRegion(CTRL_SPINBOX, PART_ENTIRE_CONTROL,
+ aArea, 0, aControlValue, rtl::OUString(), aEntireBound, aEntireContent) &&
+ GetNativeControlRegion(CTRL_SPINBOX, PART_SUB_EDIT,
+ aArea, 0, aControlValue, rtl::OUString(), aEditBound, aEditContent)
+ )
+ {
+ aSz.Width() += (aEntireContent.GetWidth() - aEditContent.GetWidth());
+ }
+ else
+ {
+ aSz.Width() += maUpperRect.GetWidth();
+ }
+ }
return aSz;
}