diff --git a/common/eda_draw_frame.cpp b/common/eda_draw_frame.cpp index 4460f28739..ba2f1a7fb1 100644 --- a/common/eda_draw_frame.cpp +++ b/common/eda_draw_frame.cpp @@ -81,7 +81,6 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame m_toolDispatcher = NULL; m_messagePanel = NULL; m_infoBar = nullptr; - m_canvasPanel = nullptr; m_currentScreen = NULL; m_showBorderAndTitleBlock = false; // true to display reference sheet. m_LastGridSizeId = 0; diff --git a/eeschema/libedit/lib_edit_frame.cpp b/eeschema/libedit/lib_edit_frame.cpp index 1b8a6266aa..bdc055bfa1 100644 --- a/eeschema/libedit/lib_edit_frame.cpp +++ b/eeschema/libedit/lib_edit_frame.cpp @@ -149,11 +149,8 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : DisplayCmpDoc(); RebuildSymbolUnitsList(); - // Create the infobar and the panel to hold it and the canvas - m_infoBar = new WX_INFOBAR( this ); - m_canvasPanel = new EDA_INFOBAR_PANEL( this ); - m_canvasPanel->AddInfoBar( m_infoBar ); - m_canvasPanel->AddOtherItem( GetCanvas() ); + // Create the infobar + m_infoBar = new WX_INFOBAR( this, &m_auimgr ); m_auimgr.SetManagedWindow( this ); @@ -161,13 +158,21 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) ); m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer(3) ); - m_auimgr.AddPane( m_treePane, EDA_PANE().Palette().Name( "ComponentTree" ).Left().Layer(1) + m_auimgr.AddPane( m_treePane, EDA_PANE().Palette().Name( "ComponentTree" ).Left().Layer(2) .Caption( _( "Libraries" ) ).MinSize( 250, -1 ) .BestSize( m_settings->m_LibWidth, -1 ).Resizable() ); - m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(1) ); + m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(2) ); + m_auimgr.AddPane( m_infoBar, + EDA_PANE().InfoBar().Name( "InfoBar" ).Top().Layer(1) ); - m_auimgr.AddPane( m_canvasPanel, wxAuiPaneInfo().Name( "DrawFrame" ).CentrePane() ); + m_auimgr.AddPane( GetCanvas(), wxAuiPaneInfo().Name( "DrawFrame" ).CentrePane() ); + // Call Update() to fix all pane default sizes, especially the "InfoBar" pane before + // hidding it. + m_auimgr.Update(); + + // We don't want the infobar displayed right away + m_auimgr.GetPane( "InfoBar" ).Hide(); m_auimgr.Update(); GetToolManager()->RunAction( "common.Control.gridPreset", true, m_LastGridSizeId ); diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 5e66406cfc..3ed7f3574a 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -241,11 +241,8 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ): ReCreateVToolbar(); ReCreateOptToolbar(); - // Create the infobar and the panel to hold it and the canvas - m_infoBar = new WX_INFOBAR( this ); - m_canvasPanel = new EDA_INFOBAR_PANEL( this ); - m_canvasPanel->AddInfoBar( m_infoBar ); - m_canvasPanel->AddOtherItem( GetCanvas() ); + // Create the infobar + m_infoBar = new WX_INFOBAR( this, &m_auimgr ); // Initialize common print setup dialog settings. m_pageSetupData.GetPrintData().SetPrintMode( wxPRINT_MODE_PRINTER ); @@ -261,11 +258,19 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ): EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer(3) ); m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(2) ); - m_auimgr.AddPane( m_canvasPanel, + m_auimgr.AddPane( m_infoBar, + EDA_PANE().InfoBar().Name( "InfoBar" ).Top().Layer(1) ); + m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() ); m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) ); + // Call Update() to fix all pane default sizes, especially the "InfoBar" pane before + // hidding it. + m_auimgr.Update(); + + // We don't want the infobar displayed right away + m_auimgr.GetPane( "InfoBar" ).Hide(); m_auimgr.Update(); GetToolManager()->RunAction( ACTIONS::zoomFitScreen, true ); diff --git a/include/eda_base_frame.h b/include/eda_base_frame.h index 1c7bc1de8e..e66fa77178 100644 --- a/include/eda_base_frame.h +++ b/include/eda_base_frame.h @@ -625,6 +625,8 @@ public: CaptionVisible( false ); Movable( false ); Resizable( true ); + PaneBorder( false ); + DockFixed( true ); return *this; } }; diff --git a/include/eda_draw_frame.h b/include/eda_draw_frame.h index f6460ec658..d891a3cdb9 100644 --- a/include/eda_draw_frame.h +++ b/include/eda_draw_frame.h @@ -116,7 +116,6 @@ protected: int m_MsgFrameHeight; WX_INFOBAR* m_infoBar; - EDA_INFOBAR_PANEL* m_canvasPanel; // The panel that holds the canvas and infobar COLOR_SETTINGS* m_colorSettings; diff --git a/include/widgets/infobar.h b/include/widgets/infobar.h index e4eff01ee1..14d5e8c8a7 100644 --- a/include/widgets/infobar.h +++ b/include/widgets/infobar.h @@ -148,6 +148,10 @@ protected: * since adding the infobar on its own to the AUI manager produces * artifacts when showing/hiding it due to the AUI pane layout. * + * Note that this implementation currently has issues on Windows with + * event processing inside the GAL canvas, see: + * https://gitlab.com/kicad/code/kicad/-/issues/4501 + * */ class EDA_INFOBAR_PANEL : public wxPanel { diff --git a/pagelayout_editor/pl_editor_frame.cpp b/pagelayout_editor/pl_editor_frame.cpp index 8ecea4d4cd..09b6790c64 100644 --- a/pagelayout_editor/pl_editor_frame.cpp +++ b/pagelayout_editor/pl_editor_frame.cpp @@ -125,17 +125,8 @@ PL_EDITOR_FRAME::PL_EDITOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) : ReCreateHToolbar(); ReCreateVToolbar(); - // TODO (ISM): Figure out why using the infobar panel doesn't work here (it works - // in the other frames) but using the AUI pane version does. - // When the panel is used, the infobar isn't shown until the window is resized - // (but the sizer has a space for it), and the sizer space doesn't disappear - // when it is dismissed until the window is resized. - - // Create the infobar and the panel to hold it and the canvas - m_infoBar = new WX_INFOBAR( this, &m_auimgr ); - //m_canvasPanel = new EDA_INFOBAR_PANEL( this ); - //m_canvasPanel->AddInfoBar( m_infoBar ); - //m_canvasPanel->AddOtherItem( GetCanvas() ); + // Create the infobar + m_infoBar = new WX_INFOBAR( this, &m_auimgr ); wxWindow* stsbar = GetStatusBar(); int dims[] = { diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 4704de19d9..d7f3fca30e 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -197,35 +197,41 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent, m_Layers->SelectLayer( F_SilkS ); m_Layers->OnLayerSelected(); - // Create the infobar and the panel to hold it and the canvas - m_infoBar = new WX_INFOBAR( this ); - m_canvasPanel = new EDA_INFOBAR_PANEL( this ); - m_canvasPanel->AddInfoBar( m_infoBar ); - m_canvasPanel->AddOtherItem( GetCanvas() ); + // Create the infobar + m_infoBar = new WX_INFOBAR( this, &m_auimgr ); m_auimgr.SetManagedWindow( this ); // Horizontal items; layers 4 - 6 m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) ); m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) ); + m_auimgr.AddPane( m_infoBar, + EDA_PANE().InfoBar().Name( "InfoBar" ).Top().Layer(1) ); // Vertical items; layers 1 - 3 m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer(3) ); - m_auimgr.AddPane( m_treePane, EDA_PANE().Palette().Name( "Footprints" ).Left().Layer(1) + m_auimgr.AddPane( m_treePane, EDA_PANE().Palette().Name( "Footprints" ).Left().Layer(2) .Caption( _( "Libraries" ) ).MinSize( 250, 400 ) .BestSize( m_defaultLibWidth, -1 ) ); - m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(1) ); + m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(2) ); m_auimgr.AddPane( m_Layers, EDA_PANE().Palette().Name( "LayersManager" ).Right().Layer(3) .Caption( _( "Layers Manager" ) ).PaneBorder( false ) .MinSize( 80, -1 ).BestSize( m_Layers->GetBestSize() ) ); - m_auimgr.AddPane( m_canvasPanel, EDA_PANE().Canvas().Name( "DrawFrame" ).Center() ); + m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() ); GetCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() ); ActivateGalCanvas(); + // Call Update() to fix all pane default sizes, especially the "InfoBar" pane before + // hidding it. m_auimgr.Update(); + + // We don't want the infobar displayed right away + m_auimgr.GetPane( "InfoBar" ).Hide(); + m_auimgr.Update(); + GetToolManager()->RunAction( ACTIONS::gridPreset, true, m_LastGridSizeId ); GetToolManager()->RunAction( ACTIONS::zoomFitScreen, false ); updateTitle(); diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 465c058b46..984bc5e6a8 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -223,11 +223,8 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : ReCreateOptToolbar(); ReCreateMicrowaveVToolbar(); - // Create the infobar and the panel to hold it and the canvas - m_infoBar = new WX_INFOBAR( this ); - m_canvasPanel = new EDA_INFOBAR_PANEL( this ); - m_canvasPanel->AddInfoBar( m_infoBar ); - m_canvasPanel->AddOtherItem( GetCanvas() ); + // Create the infobar + m_infoBar = new WX_INFOBAR( this, &m_auimgr ); m_auimgr.SetManagedWindow( this ); @@ -238,6 +235,8 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : EDA_PANE().HToolbar().Name( "AuxToolbar" ).Top().Layer(5) ); m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) ); + m_auimgr.AddPane( m_infoBar, + EDA_PANE().InfoBar().Name( "InfoBar" ).Top().Layer(1) ); // Vertical items; layers 1 - 3 m_auimgr.AddPane( m_optionsToolBar, @@ -252,7 +251,7 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : .Caption( _( "Layers Manager" ) ).PaneBorder( false ) .MinSize( 80, -1 ).BestSize( m_Layers->GetBestSize() ) ); - m_auimgr.AddPane( m_canvasPanel, EDA_PANE().Canvas().Name( "DrawFrame" ).Center() ); + m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() ); m_auimgr.GetPane( "LayersManager" ).Show( m_show_layer_manager_tools ); m_auimgr.GetPane( "MicrowaveToolbar" ).Show( m_show_microwave_tools ); @@ -262,7 +261,14 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : // because contents establish size syncLayerWidgetLayer(); + // Call Update() to fix all pane default sizes, especially the "InfoBar" pane before + // hidding it. m_auimgr.Update(); + + // We don't want the infobar displayed right away + m_auimgr.GetPane( "InfoBar" ).Hide(); + m_auimgr.Update(); + GetToolManager()->RunAction( ACTIONS::gridPreset, true, m_LastGridSizeId ); GetToolManager()->RunAction( ACTIONS::zoomFitScreen, false );