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

@ -1,98 +1,88 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project> <wxFormBuilder_Project>
<FileVersion major="1" minor="15" /> <FileVersion major="1" minor="15" />
<object class="Project" expanded="1"> <object class="Project" expanded="1">
<property name="class_decoration">; </property> <property name="class_decoration">; </property>
<property name="code_generation">C++</property> <property name="code_generation">C++</property>
<property name="disconnect_events">1</property> <property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property> <property name="disconnect_mode">source_name</property>
<property name="disconnect_php_events">0</property> <property name="disconnect_php_events">0</property>
<property name="disconnect_python_events">0</property> <property name="disconnect_python_events">0</property>
<property name="embedded_files_path">res</property> <property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property> <property name="encoding">UTF-8</property>
<property name="event_generation">connect</property> <property name="event_generation">connect</property>
<property name="file">panel_kicad_launcher_base</property> <property name="file">panel_kicad_launcher_base</property>
<property name="first_id">1000</property> <property name="first_id">1000</property>
<property name="help_provider">none</property> <property name="help_provider">none</property>
<property name="indent_with_spaces"></property> <property name="indent_with_spaces"></property>
<property name="internationalize">1</property> <property name="internationalize">1</property>
<property name="name">panel_kicad_launcher_base</property> <property name="name">panel_kicad_launcher_base</property>
<property name="namespace"></property> <property name="namespace"></property>
<property name="path">.</property> <property name="path">.</property>
<property name="precompiled_header"></property> <property name="precompiled_header"></property>
<property name="relative_path">1</property> <property name="relative_path">1</property>
<property name="skip_lua_events">1</property> <property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property> <property name="skip_php_events">1</property>
<property name="skip_python_events">1</property> <property name="skip_python_events">1</property>
<property name="ui_table">UI</property> <property name="ui_table">UI</property>
<property name="use_enum">0</property> <property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property> <property name="use_microsoft_bom">0</property>
<object class="Panel" expanded="1"> <object class="Panel" expanded="1">
<property name="aui_managed">0</property> <property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property> <property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property> <property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="event_handler">impl_virtual</property> <property name="event_handler">impl_virtual</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">PANEL_KICAD_LAUNCHER_BASE</property> <property name="name">PANEL_KICAD_LAUNCHER_BASE</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size">-1,-1</property> <property name="size">-1,-1</property>
<property name="subclass">; ; forward_declare</property> <property name="subclass">; ; forward_declare</property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property> <property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bSizer2</property> <property name="name">bSizer2</property>
<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>
<property name="name">m_mainSizer</property> <property name="name">m_mainSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxGridBagSizer" expanded="1"> <object class="wxGridBagSizer" expanded="1">
<property name="empty_cell_size"></property> <property name="empty_cell_size"></property>
<property name="flexible_direction">wxBOTH</property> <property name="flexible_direction">wxBOTH</property>
<property name="growablecols"></property> <property name="growablecols"></property>
<property name="growablerows"></property> <property name="growablerows"></property>
<property name="hgap">10</property> <property name="hgap">10</property>
<property name="minimum_size">-1,-1</property> <property name="minimum_size">-1,-1</property>
<property name="name">m_toolsSizer</property> <property name="name">m_toolsSizer</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_NONE</property> <property name="non_flexible_grow_mode">wxFLEX_GROWMODE_NONE</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="vgap">0</property> <property name="vgap">0</property>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> </object>
<property name="border">5</property> </object>
<property name="flag">wxEXPAND</property> </object>
<property name="proportion">0</property> </object>
<object class="spacer" expanded="1"> </object>
<property name="height">20</property> </wxFormBuilder_Project>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>

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