Alternative way for setting icons for align/distribute actions.

This commit is contained in:
Maciej Suminski 2017-01-23 10:59:56 +01:00
parent f0a7c1715e
commit 59346a6ef1
2 changed files with 13 additions and 20 deletions

View File

@ -580,32 +580,32 @@ TOOL_ACTION COMMON_ACTIONS::pointEditorRemoveCorner( "pcbnew.PointEditor.removeC
TOOL_ACTION COMMON_ACTIONS::alignTop( "pcbnew.Place.alignTop",
AS_GLOBAL, 0,
_( "Align items to the top" ),
_( "Aligns selected items to the top edge" ) );
_( "Aligns selected items to the top edge" ), up_xpm );
TOOL_ACTION COMMON_ACTIONS::alignBottom( "pcbnew.Place.alignBottom",
AS_GLOBAL, 0,
_( "Align items to the bottom" ),
_( "Aligns selected items to the bottom edge" ) );
_( "Aligns selected items to the bottom edge" ), down_xpm );
TOOL_ACTION COMMON_ACTIONS::alignLeft( "pcbnew.Place.alignLeft",
AS_GLOBAL, 0,
_( "Align items to the left" ),
_( "Aligns selected items to the left edge" ) );
_( "Aligns selected items to the left edge" ), left_xpm );
TOOL_ACTION COMMON_ACTIONS::alignRight( "pcbnew.Place.alignRight",
AS_GLOBAL, 0,
_( "Align items to the right" ),
_( "Aligns selected items to the right edge" ) );
_( "Aligns selected items to the right edge" ), right_xpm );
TOOL_ACTION COMMON_ACTIONS::distributeHorizontally( "pcbnew.Place.distributeHorizontally",
AS_GLOBAL, 0,
_( "Distribute horizontally" ),
_( "Distributes selected items along the horizontal axis" ) );
_( "Distributes selected items along the horizontal axis" ), distribute_horizontal_xpm );
TOOL_ACTION COMMON_ACTIONS::distributeVertically( "pcbnew.Place.distributeVertically",
AS_GLOBAL, 0,
_( "Distribute vertically" ),
_( "Distributes selected items along the vertical axis" ) );
_( "Distributes selected items along the vertical axis" ), distribute_vertical_xpm );
boost::optional<TOOL_EVENT> COMMON_ACTIONS::TranslateLegacyId( int aId )

View File

@ -61,21 +61,14 @@ bool PLACEMENT_TOOL::Init()
m_placementMenu = new CONTEXT_MENU;
m_placementMenu->SetIcon( align_items_xpm );
// Add all menuitem commands
wxMenuItem* item;
item = m_placementMenu->Add( COMMON_ACTIONS::alignTop );
SET_BITMAP( KiBitmap( up_xpm ) );
item = m_placementMenu->Add( COMMON_ACTIONS::alignBottom );
SET_BITMAP( KiBitmap( down_xpm ) );
item = m_placementMenu->Add( COMMON_ACTIONS::alignLeft );
SET_BITMAP( KiBitmap( left_xpm ) );
item = m_placementMenu->Add( COMMON_ACTIONS::alignRight );
SET_BITMAP( KiBitmap( right_xpm ) );
// Add all align/distribute commands
m_placementMenu->Add( COMMON_ACTIONS::alignTop );
m_placementMenu->Add( COMMON_ACTIONS::alignBottom );
m_placementMenu->Add( COMMON_ACTIONS::alignLeft );
m_placementMenu->Add( COMMON_ACTIONS::alignRight );
m_placementMenu->AppendSeparator();
item = m_placementMenu->Add( COMMON_ACTIONS::distributeHorizontally );
SET_BITMAP( KiBitmap( distribute_horizontal_xpm ) );
item = m_placementMenu->Add( COMMON_ACTIONS::distributeVertically );
SET_BITMAP( KiBitmap( distribute_vertical_xpm ) );
m_placementMenu->Add( COMMON_ACTIONS::distributeHorizontally );
m_placementMenu->Add( COMMON_ACTIONS::distributeVertically );
m_selectionTool->GetToolMenu().GetMenu().AddMenu(
m_placementMenu, _( "Align/distribute" ), false,