mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 23:17:35 -06:00
Added a deactivate() function to Tab so when switching tabs it hides … (#5386)
Added a deactivate() function to Tab so when switching tabs it hides the active contents. Also removed clearing of the pages so it's not destroyed each time. Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
parent
01213e58b0
commit
7a335590e2
2 changed files with 12 additions and 2 deletions
|
@ -5199,6 +5199,10 @@ bool Tab::tree_sel_change_delayed(wxCommandEvent& event)
|
|||
if (m_active_page == page)
|
||||
return false;
|
||||
|
||||
if (m_active_page != nullptr) {
|
||||
m_active_page->deactivate();
|
||||
}
|
||||
|
||||
m_active_page = page;
|
||||
|
||||
auto throw_if_canceled = std::function<void()>([this](){
|
||||
|
@ -5216,8 +5220,6 @@ bool Tab::tree_sel_change_delayed(wxCommandEvent& event)
|
|||
|
||||
try {
|
||||
m_page_view->Freeze();
|
||||
// clear pages from the controls
|
||||
clear_pages();
|
||||
throw_if_canceled();
|
||||
|
||||
//BBS: GUI refactor
|
||||
|
@ -5922,6 +5924,13 @@ void Page::activate(ConfigOptionMode mode, std::function<void()> throw_if_cancel
|
|||
#endif
|
||||
}
|
||||
|
||||
void Page::deactivate()
|
||||
{
|
||||
for (auto group : m_optgroups) {
|
||||
group->Hide();
|
||||
}
|
||||
}
|
||||
|
||||
void Page::clear()
|
||||
{
|
||||
for (auto group : m_optgroups)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue