summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-02-20 15:26:03 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-02-20 22:09:00 +0100
commitb3452d3d2db48ca2eb14e74d7ee8ca52944f114c (patch)
treef7db21b52f428ef51785099c21e8f4a9be1bb63d /vcl
parent0f3b53a1219eac898152f64dee1c1ff2809846b0 (diff)
get better optimal size for a radiobutton with an image in it
(not an image used as the indicator, which is already covered, but if an image follows the indicator Change-Id: I9e3f9c466d997f91f54912660f8c54eea6deb721 Reviewed-on: https://gerrit.libreoffice.org/68097 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/control/button.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index d4ba23064e03..a737b61abfa6 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -2844,8 +2844,15 @@ Size RadioButton::CalcMinimumSize() const
else
{
aSize = maImage.GetSizePixel();
- aSize.AdjustWidth(8 );
- aSize.AdjustHeight(8 );
+ aSize.AdjustWidth(8);
+ aSize.AdjustHeight(8);
+ }
+
+ if (Button::HasImage() && !(ImplGetButtonState() & DrawButtonFlags::NoImage))
+ {
+ Size aImgSize = GetModeImage().GetSizePixel();
+ aSize = Size(std::max(aImgSize.Width(), aSize.Width()),
+ std::max(aImgSize.Height(), aSize.Height()));
}
OUString aText = GetText();