Skip to content
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
6 changes: 6 additions & 0 deletions src/slic3r/GUI/GUI_Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,5 +602,11 @@ void WikiPanel::msw_rescale()
}
}

bool dark_mode_follow_system_enabled()
{
return wxGetApp().app_config &&
wxGetApp().app_config->get("dark_mode_follow_system") == "1";
}

}
}
6 changes: 4 additions & 2 deletions src/slic3r/GUI/GUI_Utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ class wxRect;
namespace Slic3r {
namespace GUI {

// Implemented in GUI_Utils.cpp — GUI_App.hpp cannot be included here (circular).
bool dark_mode_follow_system_enabled();

inline int hex_to_int(const char c)
{
return (c >= '0' && c <= '9') ? int(c - '0') : (c >= 'A' && c <= 'F') ? int(c - 'A') + 10 : (c >= 'a' && c <= 'f') ? int(c - 'a') + 10 : -1;
Expand Down Expand Up @@ -202,8 +205,7 @@ template<class P> class DPIAware : public P
this->Bind(wxEVT_SYS_COLOUR_CHANGED, [this](wxSysColourChangedEvent& event)
{
#ifdef __WINDOWS__
if (GUI::wxGetApp().app_config &&
GUI::wxGetApp().app_config->get("dark_mode_follow_system") == "1") {
if (dark_mode_follow_system_enabled()) {
update_dark_config();
on_sys_color_changed();
}
Expand Down