Kaydet (Commit) d2bc27c8 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: fdo#76457 image buttons too narrow

but we liked the size of the symbol buttons

regression since 1f6e8827

Really the PushButton::CalcMinimumSize and PushButton::ImplDrawPushButton are
the better place to handle this, but its such a train-wreck

Change-Id: Ib7ba00c6a9c2698ff4e4f264c4242bf48a686da8
üst c30fd602
...@@ -1614,6 +1614,7 @@ Size PushButton::CalcMinimumSize( long nMaxWidth ) const ...@@ -1614,6 +1614,7 @@ Size PushButton::CalcMinimumSize( long nMaxWidth ) const
PushButton::GetText(), ImplGetTextStyle( nDrawFlags ) ).GetSize(); PushButton::GetText(), ImplGetTextStyle( nDrawFlags ) ).GetSize();
aSize.Width() += textSize.Width(); aSize.Width() += textSize.Width();
aSize.Height() = std::max( aSize.Height(), long( textSize.Height() * 1.15 ) ); aSize.Height() = std::max( aSize.Height(), long( textSize.Height() * 1.15 ) );
}
// cf. ImplDrawPushButton ... // cf. ImplDrawPushButton ...
if( (GetStyle() & WB_SMALLSTYLE) == 0 ) if( (GetStyle() & WB_SMALLSTYLE) == 0 )
...@@ -1621,7 +1622,6 @@ Size PushButton::CalcMinimumSize( long nMaxWidth ) const ...@@ -1621,7 +1622,6 @@ Size PushButton::CalcMinimumSize( long nMaxWidth ) const
aSize.Width() += 24; aSize.Width() += 24;
aSize.Height() += 12; aSize.Height() += 12;
} }
}
return CalcWindowSize( aSize ); return CalcWindowSize( aSize );
} }
......
...@@ -384,7 +384,15 @@ VclBuilder::VclBuilder(Window *pParent, const OUString& sUIDir, const OUString& ...@@ -384,7 +384,15 @@ VclBuilder::VclBuilder(Window *pParent, const OUString& sUIDir, const OUString&
if (eType == SYMBOL_NOSYMBOL) if (eType == SYMBOL_NOSYMBOL)
continue; continue;
if (!aI->m_bRadio) if (!aI->m_bRadio)
{
pTargetButton->SetSymbol(eType); 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 else
SAL_WARN_IF(eType != SYMBOL_IMAGE, "vcl.layout", "inimplemented symbol type for radiobuttons"); SAL_WARN_IF(eType != SYMBOL_IMAGE, "vcl.layout", "inimplemented symbol type for radiobuttons");
if (eType == SYMBOL_IMAGE) if (eType == SYMBOL_IMAGE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment