KiCad: fix initial window size on windows platform.

Fixes https://gitlab.com/kicad/code/kicad/issues/8333
This commit is contained in:
Wayne Stambaugh 2021-05-11 18:43:08 -04:00
parent 57d4347f00
commit 1bf5642228
4 changed files with 102 additions and 109 deletions

View File

@ -91,9 +91,11 @@ void PANEL_KICAD_LAUNCHER::CreateLaunchers()
// sure that the BestSize isn't needed by setting wxEXPAND. Unfortunately this makes // sure that the BestSize isn't needed by setting wxEXPAND. Unfortunately this makes
// wxALIGN_BOTTOM non-functional, so we have to jump through a bunch more hoops to // wxALIGN_BOTTOM non-functional, so we have to jump through a bunch more hoops to
// try and align the title and help text in the middle of the icon. // try and align the title and help text in the middle of the icon.
m_toolsSizer->Add( label, wxGBPosition( row, 1 ), wxGBSpan( 1, 1 ), wxTOP|wxEXPAND, 10 ); m_toolsSizer->Add( label, wxGBPosition( row, 1 ), wxGBSpan( 1, 1 ),
wxTOP | wxEXPAND, 10 );
m_toolsSizer->Add( help, wxGBPosition( row + 1, 1 ), wxGBSpan( 1, 1 ), wxALIGN_TOP|wxTOP, 1 ); m_toolsSizer->Add( help, wxGBPosition( row + 1, 1 ), wxGBSpan( 1, 1 ),
wxALIGN_TOP | wxTOP, 1 );
}; };
addLauncher( KICAD_MANAGER_ACTIONS::editSchematic, addLauncher( KICAD_MANAGER_ACTIONS::editSchematic,
@ -129,9 +131,5 @@ void PANEL_KICAD_LAUNCHER::CreateLaunchers()
_( "Edit drawing sheet borders and title blocks for use in schematics and PCB " _( "Edit drawing sheet borders and title blocks for use in schematics and PCB "
"designs" ) ); "designs" ) );
if( m_toolsSizer->IsColGrowable( 1 ) )
m_toolsSizer->RemoveGrowableCol( 1 );
m_toolsSizer->AddGrowableCol( 1 );
Layout(); Layout();
} }

View File

@ -24,10 +24,7 @@ PANEL_KICAD_LAUNCHER_BASE::PANEL_KICAD_LAUNCHER_BASE( wxWindow* parent, wxWindow
m_mainSizer->Add( m_toolsSizer, 0, wxALL|wxEXPAND, 5 ); m_mainSizer->Add( m_toolsSizer, 0, wxALL|wxEXPAND, 5 );
m_mainSizer->Add( 0, 20, 0, wxEXPAND, 5 ); bSizer2->Add( m_mainSizer, 1, wxALL|wxEXPAND, 5 );
bSizer2->Add( m_mainSizer, 1, wxEXPAND|wxTOP|wxLEFT, 8 );
this->SetSizer( bSizer2 ); this->SetSizer( bSizer2 );

View File

@ -55,8 +55,8 @@
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">8</property> <property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxLEFT</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
@ -80,16 +80,6 @@
<property name="vgap">0</property> <property name="vgap">0</property>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="spacer" expanded="1">
<property name="height">20</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
</object> </object>
</object> </object>
</object> </object>

View File

@ -3,7 +3,7 @@
* *
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2013 CERN (www.cern.ch) * Copyright (C) 2013 CERN (www.cern.ch)
* Copyright (C) 2004-2020 KiCad Developers, see change_log.txt for contributors. * Copyright (C) 2004-2021 KiCad Developers, see change_log.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -165,6 +165,14 @@ KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME( wxWindow* parent, const wxString& titl
// Now the actual m_leftWin size is set, give it a reasonable min width // Now the actual m_leftWin size is set, give it a reasonable min width
m_auimgr.GetPane( m_leftWin ).MinSize( 250, -1 ); m_auimgr.GetPane( m_leftWin ).MinSize( 250, -1 );
wxSizer* mainSizer = GetSizer();
if( mainSizer )
{
mainSizer->Fit( this );
SetMinSize( GetSize() );
}
SetTitle( wxString( "KiCad " ) + GetBuildVersion() ); SetTitle( wxString( "KiCad " ) + GetBuildVersion() );
// Do not let the messages window have initial focus // Do not let the messages window have initial focus