vcl/source/control/fixed.cxx | 8 ++++++++ vcl/source/window/builder.cxx | 13 +++++++++++++ 2 files changed, 21 insertions(+)
New commits: commit c214ad383d5e7dc0a18dbe6cbfc1e32fea934fd9 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Feb 18 15:22:23 2020 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Feb 19 09:52:00 2020 +0100 support WB_SMALLSTYLE via small-toolbar icon size Change-Id: I1c232a9e14df8a15142c1670f848c32fc0a245c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88988 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx index 237f2f30e304..d64494e179a6 100644 --- a/vcl/source/control/fixed.cxx +++ b/vcl/source/control/fixed.cxx @@ -956,6 +956,14 @@ bool FixedImage::set_property(const OString &rKey, const OUString &rValue) { SetImage(loadThemeImage(rValue)); } + else if (rKey == "icon-size") + { + WinBits nBits = GetStyle(); + nBits &= ~WB_SMALLSTYLE; + if (rValue == "2") + nBits |= WB_SMALLSTYLE; + SetStyle(nBits); + } else return Control::set_property(rKey, rValue); return true; diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index caf1ec25c1e0..dd614b891fe9 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -667,7 +667,20 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const OUString& sUIDir, const OUStr if (aFind == m_pParserState->m_aStockMap.end()) { if (!elem.m_bRadio) + { pTargetButton->SetModeImage(pImage->GetImage()); + if (pImage->GetStyle() | WB_SMALLSTYLE) + { + pTargetButton->SetStyle(pTargetButton->GetStyle() | WB_SMALLSTYLE); + Size aSz(pTargetButton->GetModeImage().GetSizePixel()); + aSz.AdjustWidth(6); + aSz.AdjustHeight(6); + if (pTargetButton->get_width_request() == -1) + pTargetButton->set_width_request(aSz.Width()); + if (pTargetButton->get_height_request() == -1) + pTargetButton->set_height_request(aSz.Height()); + } + } else pTargetRadio->SetModeRadioImage(pImage->GetImage()); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits