Cosmetic fixes to the toolbar palettes

* Align the top of the buttons in the palette with the toolbar button
* Don't check the button in the palette, since the toolbar button will
  show as checked.
This commit is contained in:
Ian McInerney 2020-11-11 00:25:14 +00:00
parent d88eaaf477
commit 05595da235
1 changed files with 4 additions and 6 deletions

View File

@ -606,7 +606,7 @@ void ACTION_TOOLBAR::popupPalette( wxAuiToolBarItem* aItem )
dir = false; // Buttons are horizontal in the palette dir = false; // Buttons are horizontal in the palette
pos = ClientToScreen( toolRect.GetTopRight() ); pos = ClientToScreen( toolRect.GetTopRight() );
pos += wxPoint( m_rightPadding, // Shift right to move away from the toolbar pos += wxPoint( m_rightPadding, // Shift right to move away from the toolbar
-( PALETTE_BORDER + BUTTON_BORDER ) ); // Shift up to align the button tops -( PALETTE_BORDER ) ); // Shift up to align the button tops
break; break;
case wxAUI_DOCK_RIGHT: case wxAUI_DOCK_RIGHT:
@ -614,7 +614,7 @@ void ACTION_TOOLBAR::popupPalette( wxAuiToolBarItem* aItem )
dir = false; // Buttons are horizontal in the palette dir = false; // Buttons are horizontal in the palette
pos = ClientToScreen( toolRect.GetTopLeft() ); pos = ClientToScreen( toolRect.GetTopLeft() );
pos += wxPoint( -( paletteLongDim + m_leftPadding ), // Shift left by the entire length of the palette pos += wxPoint( -( paletteLongDim + m_leftPadding ), // Shift left by the entire length of the palette
-( PALETTE_BORDER + BUTTON_BORDER ) ); // Shift up to align the button -( PALETTE_BORDER ) ); // Shift up to align the button
break; break;
} }
@ -627,7 +627,8 @@ void ACTION_TOOLBAR::popupPalette( wxAuiToolBarItem* aItem )
NULL, this ); NULL, this );
// Add the actions in the group to the palette and update their state // Add the actions in the group to the palette and update their enabled state
// We purposely don't check items in the palette
for( const TOOL_ACTION* action : group->m_actions ) for( const TOOL_ACTION* action : group->m_actions )
{ {
wxUpdateUIEvent evt( action->GetUIId() ); wxUpdateUIEvent evt( action->GetUIId() );
@ -636,9 +637,6 @@ void ACTION_TOOLBAR::popupPalette( wxAuiToolBarItem* aItem )
m_palette->AddAction( *action ); m_palette->AddAction( *action );
if( evt.GetSetChecked() )
m_palette->CheckAction( *action, evt.GetChecked() );
if( evt.GetSetEnabled() ) if( evt.GetSetEnabled() )
m_palette->EnableAction( *action, evt.GetEnabled() ); m_palette->EnableAction( *action, evt.GetEnabled() );
} }