Manage the Search panel visibility state in view menu.
Fixes #12533 https://gitlab.com/kicad/code/kicad/issues/12533
This commit is contained in:
parent
7059ef9b89
commit
a7775bab26
|
@ -739,6 +739,12 @@ void PCB_EDIT_FRAME::setupUIConditions()
|
|||
return PropertiesShown();
|
||||
};
|
||||
|
||||
auto searchPaneCond =
|
||||
[this] ( const SELECTION& )
|
||||
{
|
||||
return m_auimgr.GetPane( SearchPaneName() ).IsShown();
|
||||
};
|
||||
|
||||
auto highContrastCond =
|
||||
[this] ( const SELECTION& )
|
||||
{
|
||||
|
@ -781,6 +787,7 @@ void PCB_EDIT_FRAME::setupUIConditions()
|
|||
.Enable( enableNetHighlightCond ) );
|
||||
mgr->SetConditions( PCB_ACTIONS::boardSetup, ENABLE( enableBoardSetupCondition ) );
|
||||
mgr->SetConditions( PCB_ACTIONS::showProperties, CHECK( propertiesCond ) );
|
||||
mgr->SetConditions( PCB_ACTIONS::showSearch, CHECK( searchPaneCond ) );
|
||||
|
||||
auto isHighlightMode =
|
||||
[this]( const SELECTION& )
|
||||
|
@ -1181,6 +1188,8 @@ void PCB_EDIT_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
|
|||
cfg->m_AuiPanels.right_panel_width = m_appearancePanel->GetSize().x;
|
||||
cfg->m_AuiPanels.appearance_panel_tab = m_appearancePanel->GetTabIndex();
|
||||
cfg->m_AuiPanels.show_properties = m_show_properties;
|
||||
// ensure m_show_search is up to date (the pane can be closed)
|
||||
m_show_search = m_auimgr.GetPane( SearchPaneName() ).IsShown();
|
||||
cfg->m_AuiPanels.show_search = m_show_search;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -798,6 +798,9 @@ void PCB_EDIT_FRAME::ToggleProperties()
|
|||
|
||||
void PCB_EDIT_FRAME::ToggleSearch()
|
||||
{
|
||||
// Ensure m_show_search is up to date (the pane can be closed outside the menu)
|
||||
m_show_search = m_auimgr.GetPane( SearchPaneName() ).IsShown();
|
||||
|
||||
m_show_search = !m_show_search;
|
||||
|
||||
m_auimgr.GetPane( SearchPaneName() ).Show( m_show_search );
|
||||
|
|
Loading…
Reference in New Issue