Don't specify sizes when we don't need to.

However, in some places we *do* have to because otherwise wxWidgets
will pick a minimum size for us (and it's rather large).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16039
This commit is contained in:
Jeff Young 2023-11-07 13:40:24 +00:00
parent abda3c0d33
commit 6d43ef5678
11 changed files with 27 additions and 28 deletions

View File

@ -74,8 +74,7 @@ PROPERTIES_PANEL::PROPERTIES_PANEL( wxWindow* aParent, EDA_BASE_FRAME* aFrame )
m_caption = new wxStaticText( this, wxID_ANY, _( "No objects selected" ) );
mainSizer->Add( m_caption, 0, wxALL | wxEXPAND, 5 );
m_grid = new wxPropertyGrid( this, wxID_ANY, wxDefaultPosition, wxSize( 300, 400 ),
wxPG_DEFAULT_STYLE );
m_grid = new wxPropertyGrid( this );
m_grid->SetUnspecifiedValueAppearance( wxPGCell( wxT( "<...>" ) ) );
m_grid->SetExtraStyle( wxPG_EX_HELP_AS_TOOLTIPS );

View File

@ -11,8 +11,6 @@
SEARCH_PANE_BASE::SEARCH_PANE_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
{
this->SetMinSize( wxSize( 360,100 ) );
m_sizerOuter = new wxBoxSizer( wxVERTICAL );
m_searchCtrl1 = new wxSearchCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
@ -29,6 +27,7 @@ SEARCH_PANE_BASE::SEARCH_PANE_BASE( wxWindow* parent, wxWindowID id, const wxPoi
this->SetSizer( m_sizerOuter );
this->Layout();
m_sizerOuter->Fit( this );
// Connect Events
this->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( SEARCH_PANE_BASE::OnSetFocus ) );

View File

@ -42,10 +42,10 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size">360,100</property>
<property name="minimum_size">-1,-1</property>
<property name="name">SEARCH_PANE_BASE</property>
<property name="pos"></property>
<property name="size">360,250</property>
<property name="size">-1,-1</property>
<property name="subclass">; ; forward_declare</property>
<property name="tooltip"></property>
<property name="two_step_creation">0</property>

View File

@ -44,7 +44,7 @@ class SEARCH_PANE_BASE : public wxPanel
public:
SEARCH_PANE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 360,250 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
SEARCH_PANE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~SEARCH_PANE_BASE();

View File

@ -97,8 +97,8 @@ const wxAuiPaneInfo& defaultPropertiesPaneInfo()
.BottomDockable( false )
.CloseButton( true )
.MinSize( 240, 60 )
.BestSize( 200, 200 )
.FloatingSize( 200, 400 )
.BestSize( 300, 200 )
.FloatingSize( 300, 400 )
.FloatingPosition( 50, 200 )
.Show( true );

View File

@ -221,16 +221,16 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
.Center() );
m_auimgr.AddPane( m_searchPane, EDA_PANE()
.Name( SearchPaneName() )
.Bottom()
.Caption( _( "Search" ) )
.PaneBorder( false )
.MinSize( 180, -1 )
.BestSize( 180, -1 )
.FloatingSize( 480, 200 )
.CloseButton( true )
.DestroyOnClose( false )
.Show( m_show_search ) );
.Name( SearchPaneName() )
.Bottom()
.Caption( _( "Search" ) )
.PaneBorder( false )
.MinSize( 180, 60 )
.BestSize( 180, 100 )
.FloatingSize( 480, 200 )
.CloseButton( true )
.DestroyOnClose( false )
.Show( m_show_search ) );
FinishAUIInitialization();

View File

@ -23,7 +23,8 @@
SCH_SEARCH_PANE::SCH_SEARCH_PANE( SCH_EDIT_FRAME* aFrame ) :
SEARCH_PANE( aFrame ), m_schFrame( aFrame )
SEARCH_PANE( aFrame ),
m_schFrame( aFrame )
{
m_sch = &(m_schFrame->Schematic());

View File

@ -226,7 +226,7 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_auimgr.AddPane( m_propertiesPanel, EDA_PANE().Name( PropertiesPaneName() )
.Left().Layer( 3 )
.Caption( _( "Properties" ) ).PaneBorder( false )
.MinSize( 240, -1 ).BestSize( 300, -1 ) );
.MinSize( 240, 60 ).BestSize( 300, 200 ) );
m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" )
.Left().Layer( 2 ) );

View File

@ -307,7 +307,7 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_auimgr.AddPane( m_propertiesPanel, EDA_PANE().Name( PropertiesPaneName() )
.Left().Layer( 5 )
.Caption( _( "Properties" ) ).PaneBorder( false )
.MinSize( 240, -1 ).BestSize( 300, -1 ) );
.MinSize( 240, 60 ).BestSize( 300, 200 ) );
// Center
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( wxS( "DrawFrame" ) )
@ -315,8 +315,8 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_auimgr.AddPane( m_searchPane, EDA_PANE().Name( SearchPaneName() )
.Bottom()
.Caption( _( "Search" ) ) .PaneBorder( false )
.MinSize( 180, -1 ).BestSize( 180, -1 )
.Caption( _( "Search" ) ).PaneBorder( false )
.MinSize( 180, 60 ).BestSize( 180, 100 )
.FloatingSize( 480, 200 )
.CloseButton( true )
.DestroyOnClose( false ) );

View File

@ -23,7 +23,8 @@
PCB_SEARCH_PANE::PCB_SEARCH_PANE( PCB_EDIT_FRAME* aFrame ) :
SEARCH_PANE( aFrame ), m_pcbFrame( aFrame )
SEARCH_PANE( aFrame ),
m_pcbFrame( aFrame )
{
m_brd = m_pcbFrame->GetBoard();

View File

@ -23,7 +23,6 @@
#include <pcb_painter.h>
#include <pcb_textbox.h>
#include <pcb_text.h>
#include <connectivity/connectivity_data.h>
#include <ratsnest/ratsnest_data.h>
#include <string_utils.h>
#include <tool/tool_manager.h>
@ -174,7 +173,7 @@ wxString ZONE_SEARCH_HANDLER::getResultCell( BOARD_ITEM* aItem, int aCol )
if( aCol == 0 )
return zone->GetZoneName();
if( aCol == 1 )
else if( aCol == 1 )
return UnescapeString( zone->GetNetname() );
else if( aCol == 2 )
{
@ -250,7 +249,7 @@ wxString TEXT_SEARCH_HANDLER::getResultCell( BOARD_ITEM* aItem, int aCol )
else if( PCB_TEXTBOX::ClassOf( aItem ) )
return UnescapeString( static_cast<PCB_TEXTBOX*>( aItem )->GetText() );
}
if( aCol == 2 )
else if( aCol == 2 )
return aItem->GetLayerName();
else if( aCol == 3 )
return m_frame->MessageTextFromValue( aItem->GetX() );