Fix usage of AUI SetAuiPaneSize() hack in FOOTPRINT_EDIT_FRAME.
This brings it in line with PCB_EDIT_FRAME, which seems to work reasonably well. Fixes https://gitlab.com/kicad/code/kicad/-/issues/14297
This commit is contained in:
parent
6f035de988
commit
c3c7f731df
|
@ -223,8 +223,9 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
.Caption( _( "Libraries" ) )
|
.Caption( _( "Libraries" ) )
|
||||||
.MinSize( 250, -1 ).BestSize( 250, -1 ) );
|
.MinSize( 250, -1 ).BestSize( 250, -1 ) );
|
||||||
m_auimgr.AddPane( m_propertiesPanel, EDA_PANE().Name( PropertiesPaneName() )
|
m_auimgr.AddPane( m_propertiesPanel, EDA_PANE().Name( PropertiesPaneName() )
|
||||||
.Left().Layer( 3 ).Caption( _( "Properties" ) )
|
.Left().Layer( 3 )
|
||||||
.PaneBorder( false ).MinSize( 240, -1 ).BestSize( 300, -1 ) );
|
.Caption( _( "Properties" ) ).PaneBorder( false )
|
||||||
|
.MinSize( 240, -1 ).BestSize( 300, -1 ) );
|
||||||
m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" )
|
m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" )
|
||||||
.Left().Layer( 2 ) );
|
.Left().Layer( 2 ) );
|
||||||
|
|
||||||
|
@ -237,7 +238,7 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
m_auimgr.AddPane( m_selectionFilterPanel, EDA_PANE().Palette().Name( "SelectionFilter" )
|
m_auimgr.AddPane( m_selectionFilterPanel, EDA_PANE().Palette().Name( "SelectionFilter" )
|
||||||
.Right().Layer( 3 ).Position( 2 )
|
.Right().Layer( 3 ).Position( 2 )
|
||||||
.Caption( _( "Selection Filter" ) ).PaneBorder( false )
|
.Caption( _( "Selection Filter" ) ).PaneBorder( false )
|
||||||
.MinSize( 160, -1 ).BestSize( m_selectionFilterPanel->GetBestSize() ) );
|
.MinSize( 180, -1 ).BestSize( 180, -1 ) );
|
||||||
|
|
||||||
// Center
|
// Center
|
||||||
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" )
|
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" )
|
||||||
|
@ -259,44 +260,21 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
FinishAUIInitialization();
|
FinishAUIInitialization();
|
||||||
|
|
||||||
// Apply saved visibility stuff at the end
|
// Apply saved visibility stuff at the end
|
||||||
FOOTPRINT_EDITOR_SETTINGS* cfg = GetSettings();
|
if( FOOTPRINT_EDITOR_SETTINGS* cfg = dynamic_cast<FOOTPRINT_EDITOR_SETTINGS*>( GetSettings() ) )
|
||||||
|
{
|
||||||
wxAuiPaneInfo& treePane = m_auimgr.GetPane( "Footprints" );
|
wxAuiPaneInfo& treePane = m_auimgr.GetPane( "Footprints" );
|
||||||
wxAuiPaneInfo& layersManager = m_auimgr.GetPane( "LayersManager" );
|
wxAuiPaneInfo& layersManager = m_auimgr.GetPane( "LayersManager" );
|
||||||
|
|
||||||
// wxAUI hack: force widths by setting MinSize() and then Fixed()
|
|
||||||
// thanks to ZenJu http://trac.wxwidgets.org/ticket/13180
|
|
||||||
|
|
||||||
if( cfg->m_LibWidth > 0 )
|
if( cfg->m_LibWidth > 0 )
|
||||||
{
|
|
||||||
SetAuiPaneSize( m_auimgr, treePane, cfg->m_LibWidth, -1 );
|
SetAuiPaneSize( m_auimgr, treePane, cfg->m_LibWidth, -1 );
|
||||||
|
|
||||||
treePane.MinSize( cfg->m_LibWidth, -1 );
|
|
||||||
treePane.Fixed();
|
|
||||||
}
|
|
||||||
|
|
||||||
if( cfg->m_AuiPanels.right_panel_width > 0 )
|
if( cfg->m_AuiPanels.right_panel_width > 0 )
|
||||||
{
|
|
||||||
SetAuiPaneSize( m_auimgr, layersManager, cfg->m_AuiPanels.right_panel_width, -1 );
|
SetAuiPaneSize( m_auimgr, layersManager, cfg->m_AuiPanels.right_panel_width, -1 );
|
||||||
|
|
||||||
layersManager.MinSize( cfg->m_LibWidth, -1 );
|
|
||||||
layersManager.Fixed();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply fixed sizes
|
|
||||||
m_auimgr.Update();
|
|
||||||
|
|
||||||
// Now make them resizable again
|
|
||||||
treePane.Resizable();
|
|
||||||
m_auimgr.Update();
|
|
||||||
|
|
||||||
// Note: DO NOT call m_auimgr.Update() anywhere after this; it will nuke the sizes
|
|
||||||
// back to minimum.
|
|
||||||
treePane.MinSize( 250, -1 );
|
|
||||||
layersManager.MinSize( 250, -1 );
|
|
||||||
|
|
||||||
m_appearancePanel->SetUserLayerPresets( cfg->m_LayerPresets );
|
m_appearancePanel->SetUserLayerPresets( cfg->m_LayerPresets );
|
||||||
m_appearancePanel->ApplyLayerPreset( cfg->m_ActiveLayerPreset );
|
m_appearancePanel->ApplyLayerPreset( cfg->m_ActiveLayerPreset );
|
||||||
m_appearancePanel->SetTabIndex( cfg->m_AuiPanels.appearance_panel_tab );
|
m_appearancePanel->SetTabIndex( cfg->m_AuiPanels.appearance_panel_tab );
|
||||||
|
}
|
||||||
|
|
||||||
GetToolManager()->PostAction( ACTIONS::zoomFitScreen );
|
GetToolManager()->PostAction( ACTIONS::zoomFitScreen );
|
||||||
UpdateTitle();
|
UpdateTitle();
|
||||||
|
|
|
@ -304,26 +304,22 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
.MinSize( 180, -1 ).BestSize( 180, -1 ) );
|
.MinSize( 180, -1 ).BestSize( 180, -1 ) );
|
||||||
|
|
||||||
m_auimgr.AddPane( m_propertiesPanel, EDA_PANE().Name( PropertiesPaneName() )
|
m_auimgr.AddPane( m_propertiesPanel, EDA_PANE().Name( PropertiesPaneName() )
|
||||||
.Left().Layer( 5 ).Caption( _( "Properties" ) )
|
.Left().Layer( 5 )
|
||||||
.PaneBorder( false ).MinSize( 240, -1 ).BestSize( 300, -1 ) );
|
.Caption( _( "Properties" ) ).PaneBorder( false )
|
||||||
|
.MinSize( 240, -1 ).BestSize( 300, -1 ) );
|
||||||
|
|
||||||
// Center
|
// Center
|
||||||
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( wxS( "DrawFrame" ) )
|
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( wxS( "DrawFrame" ) )
|
||||||
.Center() );
|
.Center() );
|
||||||
|
|
||||||
|
m_auimgr.AddPane( m_searchPane, EDA_PANE().Name( SearchPaneName() )
|
||||||
m_auimgr.AddPane( m_searchPane, EDA_PANE()
|
|
||||||
.Name( SearchPaneName() )
|
|
||||||
.Bottom()
|
.Bottom()
|
||||||
.Caption( _( "Search" ) )
|
.Caption( _( "Search" ) ) .PaneBorder( false )
|
||||||
.PaneBorder( false )
|
.MinSize( 180, -1 ).BestSize( 180, -1 )
|
||||||
.MinSize( 180, -1 )
|
|
||||||
.BestSize( 180, -1 )
|
|
||||||
.FloatingSize( 480, 200 )
|
.FloatingSize( 480, 200 )
|
||||||
.CloseButton( true )
|
.CloseButton( true )
|
||||||
.DestroyOnClose( false ) );
|
.DestroyOnClose( false ) );
|
||||||
|
|
||||||
|
|
||||||
m_auimgr.GetPane( "LayersManager" ).Show( m_show_layer_manager_tools );
|
m_auimgr.GetPane( "LayersManager" ).Show( m_show_layer_manager_tools );
|
||||||
m_auimgr.GetPane( "SelectionFilter" ).Show( m_show_layer_manager_tools );
|
m_auimgr.GetPane( "SelectionFilter" ).Show( m_show_layer_manager_tools );
|
||||||
m_auimgr.GetPane( PropertiesPaneName() ).Show( GetPcbNewSettings()->m_AuiPanels.show_properties );
|
m_auimgr.GetPane( PropertiesPaneName() ).Show( GetPcbNewSettings()->m_AuiPanels.show_properties );
|
||||||
|
@ -358,7 +354,6 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
searchPane.Direction( settings->m_AuiPanels.search_panel_dock_direction );
|
searchPane.Direction( settings->m_AuiPanels.search_panel_dock_direction );
|
||||||
SetAuiPaneSize( m_auimgr, searchPane, -1, settings->m_AuiPanels.search_panel_height );
|
SetAuiPaneSize( m_auimgr, searchPane, -1, settings->m_AuiPanels.search_panel_height );
|
||||||
}
|
}
|
||||||
|
|
||||||
else if( settings->m_AuiPanels.search_panel_width > 0
|
else if( settings->m_AuiPanels.search_panel_width > 0
|
||||||
&& ( settings->m_AuiPanels.search_panel_dock_direction == wxAUI_DOCK_LEFT
|
&& ( settings->m_AuiPanels.search_panel_dock_direction == wxAUI_DOCK_LEFT
|
||||||
|| settings->m_AuiPanels.search_panel_dock_direction == wxAUI_DOCK_RIGHT ) )
|
|| settings->m_AuiPanels.search_panel_dock_direction == wxAUI_DOCK_RIGHT ) )
|
||||||
|
|
Loading…
Reference in New Issue