Fixed update of the TreeCtrls and "revert to system values" buttons on preset tabs, if application was run in New or Dlg mode
This commit is contained in:
parent
435355adfe
commit
2f43c1f3fa
1 changed files with 11 additions and 0 deletions
|
@ -1527,6 +1527,7 @@ void MainFrame::load_config(const DynamicPrintConfig& config)
|
||||||
|
|
||||||
void MainFrame::select_tab(size_t tab/* = size_t(-1)*/)
|
void MainFrame::select_tab(size_t tab/* = size_t(-1)*/)
|
||||||
{
|
{
|
||||||
|
bool tabpanel_was_hidden = false;
|
||||||
#if ENABLE_LAYOUT_NO_RESTART
|
#if ENABLE_LAYOUT_NO_RESTART
|
||||||
if (m_layout == ESettingsLayout::Dlg) {
|
if (m_layout == ESettingsLayout::Dlg) {
|
||||||
#else
|
#else
|
||||||
|
@ -1557,6 +1558,7 @@ void MainFrame::select_tab(size_t tab/* = size_t(-1)*/)
|
||||||
if (m_settings_dialog.IsShown())
|
if (m_settings_dialog.IsShown())
|
||||||
m_settings_dialog.SetFocus();
|
m_settings_dialog.SetFocus();
|
||||||
else {
|
else {
|
||||||
|
tabpanel_was_hidden = true;
|
||||||
m_tabpanel->Show();
|
m_tabpanel->Show();
|
||||||
m_settings_dialog.Show();
|
m_settings_dialog.Show();
|
||||||
}
|
}
|
||||||
|
@ -1576,6 +1578,7 @@ void MainFrame::select_tab(size_t tab/* = size_t(-1)*/)
|
||||||
#if ENABLE_LAYOUT_NO_RESTART
|
#if ENABLE_LAYOUT_NO_RESTART
|
||||||
else if (m_layout == ESettingsLayout::New) {
|
else if (m_layout == ESettingsLayout::New) {
|
||||||
m_main_sizer->Show(m_plater, tab == 0);
|
m_main_sizer->Show(m_plater, tab == 0);
|
||||||
|
tabpanel_was_hidden = !m_main_sizer->IsShown(m_tabpanel);
|
||||||
m_main_sizer->Show(m_tabpanel, tab != 0);
|
m_main_sizer->Show(m_tabpanel, tab != 0);
|
||||||
#else
|
#else
|
||||||
else if (m_layout == slNew) {
|
else if (m_layout == slNew) {
|
||||||
|
@ -1589,6 +1592,14 @@ void MainFrame::select_tab(size_t tab/* = size_t(-1)*/)
|
||||||
Layout();
|
Layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// When we run application in ESettingsLayout::New or ESettingsLayout::Dlg mode, tabpanel is hidden from the very beginning
|
||||||
|
// and as a result Tab::update_changed_tree_ui() function couldn't update m_is_nonsys_values values,
|
||||||
|
// which are used for update TreeCtrl and "revert_buttons".
|
||||||
|
// So, force the call of this function for Tabs, if tab panel was hidden
|
||||||
|
if (tabpanel_was_hidden)
|
||||||
|
for (auto tab : wxGetApp().tabs_list)
|
||||||
|
tab->update_changed_tree_ui();
|
||||||
|
|
||||||
// when tab == -1, it means we should show the last selected tab
|
// when tab == -1, it means we should show the last selected tab
|
||||||
#if ENABLE_LAYOUT_NO_RESTART
|
#if ENABLE_LAYOUT_NO_RESTART
|
||||||
m_tabpanel->SetSelection(tab == (size_t)(-1) ? m_last_selected_tab : (m_layout == ESettingsLayout::Dlg && tab != 0) ? tab - 1 : tab);
|
m_tabpanel->SetSelection(tab == (size_t)(-1) ? m_last_selected_tab : (m_layout == ESettingsLayout::Dlg && tab != 0) ? tab - 1 : tab);
|
||||||
|
|
Loading…
Reference in a new issue