mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Warp back from context menu before running command.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19560
This commit is contained in:
parent
6471db70cd
commit
74bf678d99
@ -1011,6 +1011,16 @@ void TOOL_MANAGER::DispatchContextMenu( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
|
||||
|
||||
void TOOL_MANAGER::WarpAfterContextMenu()
|
||||
{
|
||||
if( m_viewControls && m_warpMouseAfterContextMenu )
|
||||
m_viewControls->WarpMouseCursor( m_menuCursor, true, false );
|
||||
|
||||
// Don't warp again when the menu is closed
|
||||
m_warpMouseAfterContextMenu = false;
|
||||
}
|
||||
|
||||
|
||||
TOOL_MANAGER::ID_LIST::iterator TOOL_MANAGER::finishTool( TOOL_STATE* aState )
|
||||
{
|
||||
auto it = std::find( m_activeTools.begin(), m_activeTools.end(), aState->theTool->GetId() );
|
||||
|
@ -517,6 +517,15 @@ public:
|
||||
m_warpMouseAfterContextMenu = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Normally we warp the mouse after the context menu action runs. This works fine for
|
||||
* something like the properties dialog, where you can continue drawing after the warp.
|
||||
* However, if the menu command itself is a drawing action (such as "Attempt Finish",
|
||||
* it will run before the warp (ie: from the position the command was in on the context
|
||||
* menu). This call allows an action to perform the warp before it is run.
|
||||
*/
|
||||
void WarpAfterContextMenu();
|
||||
|
||||
/**
|
||||
* Handle context menu related events.
|
||||
*/
|
||||
|
@ -1337,6 +1337,9 @@ void ROUTER_TOOL::performRouting( VECTOR2D aStartPosition )
|
||||
}
|
||||
else if( evt->IsAction( &PCB_ACTIONS::routerAttemptFinish ) )
|
||||
{
|
||||
if( m_toolMgr->IsContextMenuActive() )
|
||||
m_toolMgr->WarpAfterContextMenu();
|
||||
|
||||
bool* autoRouted = evt->Parameter<bool*>();
|
||||
|
||||
if( m_router->Finish() )
|
||||
|
Loading…
x
Reference in New Issue
Block a user