Don't use TOOL_EVENT parameters for line modes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15053
This commit is contained in:
parent
493828cc6b
commit
84a63f7daa
|
@ -889,32 +889,22 @@ TOOL_ACTION EE_ACTIONS::toggleOPCurrents( "eeschema.EditorControl.showOperatingP
|
|||
_( "Show OP Currents" ),
|
||||
_( "Show operating point current data from simulation" ) );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::lineModeFree( TOOL_ACTION_ARGS()
|
||||
.Name( "eeschema.EditorControl.lineModeFree" )
|
||||
.Scope( AS_GLOBAL )
|
||||
.MenuText( _( "Line Mode for Wires and Buses" ) )
|
||||
.Tooltip( _( "Draw and drag at any angle" ) )
|
||||
.Icon( BITMAPS::lines_any )
|
||||
.Flags( AF_NONE )
|
||||
.Parameter( LINE_MODE::LINE_MODE_FREE ) );
|
||||
TOOL_ACTION EE_ACTIONS::lineModeFree( "eeschema.EditorControl.lineModeFree",
|
||||
AS_GLOBAL, 0, "",
|
||||
_( "Line Mode for Wires and Buses" ), _( "Draw and drag at any angle" ),
|
||||
BITMAPS::lines_any );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::lineMode90( TOOL_ACTION_ARGS()
|
||||
.Name( "eeschema.EditorControl.lineModeOrthonal" )
|
||||
.Scope( AS_GLOBAL )
|
||||
.MenuText( _( "Line Mode for Wires and Buses" ) )
|
||||
.Tooltip( _( "Constrain drawing and dragging to horizontal or vertical motions" ) )
|
||||
.Icon( BITMAPS::lines90 )
|
||||
.Flags( AF_NONE )
|
||||
.Parameter( LINE_MODE::LINE_MODE_90) );
|
||||
TOOL_ACTION EE_ACTIONS::lineMode90( "eeschema.EditorControl.lineModeOrthonal",
|
||||
AS_GLOBAL, 0, "",
|
||||
_( "Line Mode for Wires and Buses" ),
|
||||
_( "Constrain drawing and dragging to horizontal or vertical motions" ),
|
||||
BITMAPS::lines90 );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::lineMode45( TOOL_ACTION_ARGS()
|
||||
.Name( "eeschema.EditorControl.lineMode45" )
|
||||
.Scope( AS_GLOBAL )
|
||||
.MenuText( _( "Line Mode for Wires and Buses" ) )
|
||||
.Tooltip( _( "Constrain drawing and dragging to horizontal, vertical, or 45-degree angle motions" ) )
|
||||
.Icon( BITMAPS::hv45mode )
|
||||
.Flags( AF_NONE )
|
||||
.Parameter( LINE_MODE::LINE_MODE_45 ) );
|
||||
TOOL_ACTION EE_ACTIONS::lineMode45( "eeschema.EditorControl.lineMode45",
|
||||
AS_GLOBAL, 0, "",
|
||||
_( "Line Mode for Wires and Buses" ),
|
||||
_( "Constrain drawing and dragging to horizontal, vertical, or 45-degree angle motions" ),
|
||||
BITMAPS::hv45mode );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::lineModeNext( "eeschema.EditorControl.lineModeNext",
|
||||
AS_GLOBAL, MD_SHIFT + WXK_SPACE, "",
|
||||
|
|
|
@ -2231,7 +2231,13 @@ int SCH_EDITOR_CONTROL::ToggleOPCurrents( const TOOL_EVENT& aEvent )
|
|||
|
||||
int SCH_EDITOR_CONTROL::ChangeLineMode( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
m_frame->eeconfig()->m_Drawing.line_mode = aEvent.Parameter<int>();
|
||||
if( aEvent.IsAction( &EE_ACTIONS::lineModeFree ) )
|
||||
m_frame->eeconfig()->m_Drawing.line_mode = LINE_MODE::LINE_MODE_FREE;
|
||||
else if( aEvent.IsAction( &EE_ACTIONS::lineMode45 ) )
|
||||
m_frame->eeconfig()->m_Drawing.line_mode = LINE_MODE::LINE_MODE_45;
|
||||
else
|
||||
m_frame->eeconfig()->m_Drawing.line_mode = LINE_MODE::LINE_MODE_90;
|
||||
|
||||
m_toolMgr->RunAction( ACTIONS::refreshPreview );
|
||||
return 0;
|
||||
}
|
||||
|
@ -2264,7 +2270,6 @@ int SCH_EDITOR_CONTROL::ToggleAnnotateRecursive( const TOOL_EVENT& aEvent )
|
|||
|
||||
int SCH_EDITOR_CONTROL::TogglePythonConsole( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
|
||||
m_frame->ScriptingConsoleEnableDisable();
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue