Add zone display mode toggle action.

Fixes: lp:1759574
* https://bugs.launchpad.net/kicad/+bug/1759574
This commit is contained in:
Jeff Young 2019-06-21 11:26:59 +01:00
parent fbfcba6e4d
commit ba7cf09ad5
3 changed files with 13 additions and 2 deletions

View File

@ -702,7 +702,7 @@ TOOL_ACTION PCB_ACTIONS::moduleEdgeOutlines( "pcbnew.Control.graphicOutlines",
TOOL_ACTION PCB_ACTIONS::zoneDisplayEnable( "pcbnew.Control.zoneDisplayEnable",
AS_GLOBAL, 0, "",
_( "Fill Zones" ), _( "Show filled areas of zones" ),
show_zone_xpm);
show_zone_xpm );
TOOL_ACTION PCB_ACTIONS::zoneDisplayDisable( "pcbnew.Control.zoneDisplayDisable",
AS_GLOBAL, 0, "",
@ -712,7 +712,14 @@ TOOL_ACTION PCB_ACTIONS::zoneDisplayDisable( "pcbnew.Control.zoneDisplayDisable"
TOOL_ACTION PCB_ACTIONS::zoneDisplayOutlines( "pcbnew.Control.zoneDisplayOutlines",
AS_GLOBAL, 0, "",
_( "Sketch Zones" ), _( "Show solid areas of zones in outline mode" ),
show_zone_outline_only_xpm);
show_zone_outline_only_xpm );
TOOL_ACTION PCB_ACTIONS::zoneDisplayToggle( "pcbnew.Control.zoneDisplayToggle",
AS_GLOBAL,
'Z', "",
_( "Toggle Zone Display" ),
_( "Cycle between showing filled zones, wireframed zones and sketched zones" ),
show_zone_xpm );
// Layer control

View File

@ -226,6 +226,7 @@ public:
static TOOL_ACTION zoneDisplayEnable;
static TOOL_ACTION zoneDisplayDisable;
static TOOL_ACTION zoneDisplayOutlines;
static TOOL_ACTION zoneDisplayToggle;
// Layer control
static TOOL_ACTION layerTop;

View File

@ -256,6 +256,8 @@ int PCBNEW_CONTROL::ZoneDisplayMode( const TOOL_EVENT& aEvent )
opts->m_DisplayZonesMode = 1;
else if( aEvent.IsAction( &PCB_ACTIONS::zoneDisplayOutlines ) )
opts->m_DisplayZonesMode = 2;
else if( aEvent.IsAction( &PCB_ACTIONS::zoneDisplayToggle ) )
opts->m_DisplayZonesMode = ( opts->m_DisplayZonesMode + 1 ) % 3;
else
wxFAIL;
@ -906,6 +908,7 @@ void PCBNEW_CONTROL::setTransitions()
Go( &PCBNEW_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayEnable.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayDisable.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayOutlines.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayToggle.MakeEvent() );
Go( &PCBNEW_CONTROL::HighContrastMode, ACTIONS::highContrastMode.MakeEvent() );
// Layer control