mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-10 08:17:51 -06:00
Added processing of a wxEVT_SYS_COLOUR_CHANGED event.
Deleted scale from ImGuiWrapper::load_svg(), because it's no needed and it makes icons bad scaled on Retina displays
This commit is contained in:
parent
ae7bb123a9
commit
4348b177d6
2 changed files with 21 additions and 10 deletions
|
@ -190,6 +190,27 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S
|
|||
event.Skip();
|
||||
});
|
||||
|
||||
Bind(wxEVT_SYS_COLOUR_CHANGED, [this](wxSysColourChangedEvent& event)
|
||||
{
|
||||
bool recreate_gui = false;
|
||||
{
|
||||
// the dialog needs to be destroyed before the call to recreate_gui()
|
||||
// or sometimes the application crashes into wxDialogBase() destructor
|
||||
// so we put it into an inner scope
|
||||
wxMessageDialog dialog(nullptr,
|
||||
_L("System color mode was changed. "
|
||||
"It is possible to update the Slicer in respect to the system mode.") + "\n" +
|
||||
_L("You will lose content of the plater.") + "\n\n" +
|
||||
_L("Do you want to proceed?"),
|
||||
wxString(SLIC3R_APP_NAME) + " - " + _L("Switching system color mode"),
|
||||
wxICON_QUESTION | wxOK | wxCANCEL);
|
||||
recreate_gui = dialog.ShowModal() == wxID_OK;
|
||||
}
|
||||
if (recreate_gui)
|
||||
wxGetApp().recreate_GUI(_L("Changing of an application in respect to the system mode") + dots);
|
||||
event.Skip();
|
||||
});
|
||||
|
||||
wxGetApp().persist_window_geometry(this, true);
|
||||
|
||||
update_ui_from_settings(); // FIXME (?)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue