[Libreoffice-commits] core.git: vcl/source
Caolán McNamara
caolanm at redhat.com
Fri Mar 21 13:40:30 PDT 2014
vcl/source/control/button.cxx | 12 ++++++------
vcl/source/window/builder.cxx | 8 ++++++++
2 files changed, 14 insertions(+), 6 deletions(-)
New commits:
commit d2bc27c85b7c0976921d704f73286dc771d4f67b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Mar 21 20:35:56 2014 +0000
Resolves: fdo#76457 image buttons too narrow
but we liked the size of the symbol buttons
regression since 1f6e88276006bea5d597ee6ca6fdf3af4dbf5ffd
Really the PushButton::CalcMinimumSize and PushButton::ImplDrawPushButton are
the better place to handle this, but its such a train-wreck
Change-Id: Ib7ba00c6a9c2698ff4e4f264c4242bf48a686da8
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 8a8d126..3086de5 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1614,13 +1614,13 @@ Size PushButton::CalcMinimumSize( long nMaxWidth ) const
PushButton::GetText(), ImplGetTextStyle( nDrawFlags ) ).GetSize();
aSize.Width() += textSize.Width();
aSize.Height() = std::max( aSize.Height(), long( textSize.Height() * 1.15 ) );
+ }
- // cf. ImplDrawPushButton ...
- if( (GetStyle() & WB_SMALLSTYLE) == 0 )
- {
- aSize.Width() += 24;
- aSize.Height() += 12;
- }
+ // cf. ImplDrawPushButton ...
+ if( (GetStyle() & WB_SMALLSTYLE) == 0 )
+ {
+ aSize.Width() += 24;
+ aSize.Height() += 12;
}
return CalcWindowSize( aSize );
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index c4fe9ac..6ba769d 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -384,7 +384,15 @@ VclBuilder::VclBuilder(Window *pParent, const OUString& sUIDir, const OUString&
if (eType == SYMBOL_NOSYMBOL)
continue;
if (!aI->m_bRadio)
+ {
pTargetButton->SetSymbol(eType);
+ //fdo#76457 keep symbol images small e.g. tools->customize->menu
+ //but images the right size. Really the PushButton::CalcMinimumSize
+ //and PushButton::ImplDrawPushButton are the better place to handle
+ //this, but its such a train-wreck
+ if (eType != SYMBOL_IMAGE)
+ pTargetButton->SetStyle(pTargetButton->GetStyle() | WB_SMALLSTYLE);
+ }
else
SAL_WARN_IF(eType != SYMBOL_IMAGE, "vcl.layout", "inimplemented symbol type for radiobuttons");
if (eType == SYMBOL_IMAGE)
More information about the Libreoffice-commits
mailing list