Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a deactivate() function to Tab so when switching tabs it hides … #5386

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/slic3r/GUI/Tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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](){
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/slic3r/GUI/Tab.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class Page// : public wxScrolledWindow
void reload_config();
void update_visibility(ConfigOptionMode mode, bool update_contolls_visibility);
void activate(ConfigOptionMode mode, std::function<void()> throw_if_canceled);
void deactivate();
void clear();
void msw_rescale();
void sys_color_changed();
Expand Down
Loading