Browse Source

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
newinvert
Jeff Young 2 years ago
parent
commit
6d43ef5678
  1. 3
      common/widgets/properties_panel.cpp
  2. 3
      common/widgets/search_pane_base.cpp
  3. 4
      common/widgets/search_pane_base.fbp
  4. 2
      common/widgets/search_pane_base.h
  5. 4
      eeschema/eeschema_settings.cpp
  6. 20
      eeschema/sch_edit_frame.cpp
  7. 3
      eeschema/widgets/sch_search_pane.cpp
  8. 2
      pcbnew/footprint_edit_frame.cpp
  9. 6
      pcbnew/pcb_edit_frame.cpp
  10. 3
      pcbnew/widgets/pcb_search_pane.cpp
  11. 5
      pcbnew/widgets/search_handlers.cpp

3
common/widgets/properties_panel.cpp

@ -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 );

3
common/widgets/search_pane_base.cpp

@ -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 ) );

4
common/widgets/search_pane_base.fbp

@ -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>

2
common/widgets/search_pane_base.h

@ -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();

4
eeschema/eeschema_settings.cpp

@ -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 );

20
eeschema/sch_edit_frame.cpp

@ -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();

3
eeschema/widgets/sch_search_pane.cpp

@ -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());

2
pcbnew/footprint_edit_frame.cpp

@ -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 ) );

6
pcbnew/pcb_edit_frame.cpp

@ -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 ) );

3
pcbnew/widgets/pcb_search_pane.cpp

@ -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();

5
pcbnew/widgets/search_handlers.cpp

@ -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() );

Loading…
Cancel
Save