Rewrite window positioning logic

Now only reposition a window if it is completely on a
disconnected display or if only one corner is on screen
and it is within a region close to the screen border.

CHANGED: Window position on startup should be preserved more
This commit is contained in:
Ian McInerney
2020-04-18 00:47:38 +01:00
parent b8d2802cfe
commit 3b67e3d0a4
11 changed files with 114 additions and 48 deletions
+3 -5
View File
@@ -136,9 +136,6 @@ SIM_PLOT_FRAME::SIM_PLOT_FRAME( KIWAY* aKiway, wxWindow* aParent )
icon.CopyFromBitmap( KiBitmap( simulator_xpm ) );
SetIcon( icon );
// Gives a minimal size
SetSizeHints( 500, 400, -1, -1, -1, -1 );
// Get the previous size and position of windows:
LoadSettings( config() );
@@ -224,6 +221,9 @@ SIM_PLOT_FRAME::SIM_PLOT_FRAME( KIWAY* aKiway, wxWindow* aParent )
// events
wxSafeYield();
setSubWindowsSashSize();
// Ensure the window is on top
Raise();
}
@@ -265,8 +265,6 @@ void SIM_PLOT_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
{
EDA_BASE_FRAME::LoadSettings( cfg );
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
// Read subwindows sizes (should be > 0 )
m_splitterLeftRightSashPosition = cfg->m_Simulator.plot_panel_width;
m_splitterPlotAndConsoleSashPosition = cfg->m_Simulator.plot_panel_height;