Make the python window follow the parent app
The Python window is pinned to the main KiCad application but to the user, it appears that the window opens in response to their clicking eeschema or pcbnew. For this reason, we should re-center the python window when the user will expect to see it when showing. Fixes https://gitlab.com/kicad/code/kicad/issues/8623
This commit is contained in:
parent
becc3a228e
commit
8a5388cf65
|
@ -214,6 +214,9 @@ void EDA_DRAW_FRAME::ScriptingConsoleEnableDisable()
|
|||
{
|
||||
KIWAY_PLAYER* frame = Kiway().Player( FRAME_PYTHON, false );
|
||||
|
||||
wxRect rect = GetScreenRect();
|
||||
wxPoint center = rect.GetPosition() + rect.GetSize() / 2;
|
||||
|
||||
if( !frame )
|
||||
{
|
||||
frame = Kiway().Player( FRAME_PYTHON, true, Kiway().GetTop() );
|
||||
|
@ -230,11 +233,13 @@ void EDA_DRAW_FRAME::ScriptingConsoleEnableDisable()
|
|||
frame->Iconize( false );
|
||||
|
||||
frame->Raise();
|
||||
frame->SetPosition( center - frame->GetSize() / 2 );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
frame->Show( !frame->IsVisible() );
|
||||
frame->SetPosition( center - frame->GetSize() / 2 );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue