Fix launcher buttons on macOS
This commit is contained in:
parent
f4b872226b
commit
96d203477e
|
@ -125,12 +125,12 @@ void ACTION_TOOLBAR_PALETTE::AddAction( const TOOL_ACTION& aAction )
|
|||
BITMAP_BUTTON* button = new BITMAP_BUTTON( m_panel, aAction.GetUIId(), wxDefaultPosition,
|
||||
bmSize );
|
||||
|
||||
button->SetIsToolbarButton();
|
||||
button->SetBitmap( normalBmp );
|
||||
button->SetDisabledBitmap( KiDisabledBitmapBundle( aAction.GetIcon() ) );
|
||||
button->SetPadding( padding );
|
||||
button->SetToolTip( aAction.GetTooltip() );
|
||||
button->AcceptDragInAsClick();
|
||||
button->SetIsToolbarButton();
|
||||
button->SetBitmapCentered();
|
||||
|
||||
m_buttons[aAction.GetUIId()] = button;
|
||||
|
|
|
@ -105,7 +105,21 @@ void BITMAP_BUTTON::SetPadding( int aPadding )
|
|||
void BITMAP_BUTTON::SetBitmap( const wxBitmapBundle& aBmp )
|
||||
{
|
||||
m_normalBitmap = aBmp;
|
||||
m_unadjustedMinSize = m_normalBitmap.GetPreferredBitmapSizeFor( this );
|
||||
|
||||
// This is a bit of a hack, but fixes button scaling issues on some platforms when those buttons
|
||||
// use KiScaledBitmap. When that method is retired, this can probably be revisited.
|
||||
if( m_isToolbarButton )
|
||||
{
|
||||
m_unadjustedMinSize = m_normalBitmap.GetPreferredBitmapSizeFor( this );
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifndef __WXMSW__
|
||||
m_unadjustedMinSize = m_normalBitmap.GetDefaultSize();
|
||||
#else
|
||||
m_unadjustedMinSize = m_normalBitmap.GetPreferredBitmapSizeFor( this );
|
||||
#endif
|
||||
}
|
||||
|
||||
SetMinSize( wxSize( m_unadjustedMinSize.GetWidth() + ( m_padding * 2 ),
|
||||
m_unadjustedMinSize.GetHeight() + ( m_padding * 2 ) ) );
|
||||
|
|
Loading…
Reference in New Issue