toolbars_lib_view.cpp and toolbars_libedit.cpp: do not recreate comboboxes
when clearing toolbars. Clearing toolbars delete only tools, not other widgets. recreating comboboxes creates strange cosmetic issues. Fixes #4542 https://gitlab.com/kicad/code/kicad/issues/4542
This commit is contained in:
parent
449c90a0ae
commit
598ed8b394
|
@ -102,7 +102,8 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame
|
|||
wxDefaultPosition, wxDefaultSize,
|
||||
aFrameType == FRAME_SCH_VIEWER_MODAL ? LIB_VIEW_STYLE_MODAL : LIB_VIEW_STYLE,
|
||||
aFrameType == FRAME_SCH_VIEWER_MODAL ? LIB_VIEW_NAME_MODAL : LIB_VIEW_NAME ),
|
||||
m_libList( nullptr ), m_cmpList( nullptr ), m_previewItem( nullptr )
|
||||
m_unitChoice( nullptr ), m_libList( nullptr ),
|
||||
m_cmpList( nullptr ), m_previewItem( nullptr )
|
||||
{
|
||||
wxASSERT( aFrameType == FRAME_SCH_VIEWER || aFrameType == FRAME_SCH_VIEWER_MODAL );
|
||||
|
||||
|
|
|
@ -112,6 +112,8 @@ void LIB_EDIT_FRAME::ReCreateHToolbar()
|
|||
m_mainToolBar->Add( EE_ACTIONS::showDeMorganAlternate, ACTION_TOOLBAR::TOGGLE );
|
||||
|
||||
KiScaledSeparator( m_mainToolBar, this );
|
||||
|
||||
if( m_unitSelectBox == nullptr )
|
||||
m_unitSelectBox = new wxComboBox( m_mainToolBar, ID_LIBEDIT_SELECT_PART_NUMBER, wxEmptyString,
|
||||
wxDefaultPosition, wxSize( LISTBOX_WIDTH, -1 ), 0, nullptr,
|
||||
wxCB_READONLY );
|
||||
|
|
|
@ -69,6 +69,8 @@ void LIB_VIEW_FRAME::ReCreateHToolbar()
|
|||
toolbar->Add( EE_ACTIONS::showDeMorganAlternate, ACTION_TOOLBAR::TOGGLE );
|
||||
|
||||
KiScaledSeparator( m_mainToolBar, this );
|
||||
|
||||
if( m_unitChoice == nullptr )
|
||||
m_unitChoice = new wxChoice( m_mainToolBar, ID_LIBVIEW_SELECT_PART_NUMBER,
|
||||
wxDefaultPosition, wxSize( 150, -1 ) );
|
||||
m_mainToolBar->AddControl( m_unitChoice );
|
||||
|
|
Loading…
Reference in New Issue