summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-03-21 20:35:56 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-03-21 20:38:26 +0000
commitd2bc27c85b7c0976921d704f73286dc771d4f67b (patch)
tree5851edc05cee71ad5dbe5ffc03f365edddf14d11
parentc30fd602521986348ef952b7173ea37a064ee82b (diff)
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
-rw-r--r--vcl/source/control/button.cxx12
-rw-r--r--vcl/source/window/builder.cxx8
2 files changed, 14 insertions, 6 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 8a8d12629d26..3086de5cbb40 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 c4fe9acce6ff..6ba769d5864d 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)