[Libreoffice-commits] core.git: vcl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Feb 20 21:09:30 UTC 2019
vcl/source/control/button.cxx | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
New commits:
commit b3452d3d2db48ca2eb14e74d7ee8ca52944f114c
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Feb 20 15:26:03 2019 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Feb 20 22:09:00 2019 +0100
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 at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
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();
More information about the Libreoffice-commits
mailing list