Skip to content

Commit

Permalink
Fix MSW TreeCtrl higlights not applied at startup
Browse files Browse the repository at this point in the history
Delay then force update_layout() for dlg_settings_layout_mode first time.
This forces dark mode to be fully applied to the non-modal settings window on startup.
  • Loading branch information
n8bot committed Dec 16, 2021
1 parent be55bb3 commit d639615
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/slic3r/GUI/GUI_App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,11 @@ bool GUI_App::on_init_inner()
});

m_initialized = true;
#ifdef __WINDOWS__
wxGetApp().update_ui_from_settings();
if (wxGetApp().app_config->get("dlg_settings_layout_mode") == "1")
mainframe->update_layout(); // force recreation of layout in case non-modal settings dialog is used
#endif //__WINDOWS__
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/GUI_App.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class GUI_App : public wxApp
wxColour m_color_hovered_btn_label;
wxColour m_color_highlight_default;
wxColour m_color_selected_btn_bg;
bool m_force_colors_update { false };
bool m_force_colors_update { true };
#endif

wxFont m_small_font;
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/MainFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ void MainFrame::update_layout()
ESettingsLayout layout = wxGetApp().is_gcode_viewer() ? ESettingsLayout::GCodeViewer :
(wxGetApp().app_config->get("old_settings_layout_mode") == "1" ? ESettingsLayout::Old :
wxGetApp().app_config->get("new_settings_layout_mode") == "1" ? ( wxGetApp().tabs_as_menu() ? ESettingsLayout::Old : ESettingsLayout::New) :
wxGetApp().app_config->get("dlg_settings_layout_mode") == "1" ? ESettingsLayout::Dlg : ESettingsLayout::Old);
wxGetApp().app_config->get("dlg_settings_layout_mode") == "1" && wxGetApp().initialized() ? ESettingsLayout::Dlg : ESettingsLayout::Old);

if (m_layout == layout)
return;
Expand Down

0 comments on commit d639615

Please sign in to comment.