Fixed a Dialog position under OSX

Always set parent for the Dialog, if we want to see the Dialog in the same display as a parent.
Dialog will be shown in the primary monitor otherwise.

+ fixed a draw of the canvas legend when we move application between Retina and non-Retina displays
This commit is contained in:
YuSanka 2020-11-05 20:50:49 +01:00 committed by Oleksandra Yushchenko
parent 95d808f7c4
commit f0a339758b
14 changed files with 38 additions and 26 deletions

View file

@ -522,7 +522,7 @@ void UnsavedChangesModel::Rescale()
//------------------------------------------
UnsavedChangesDialog::UnsavedChangesDialog(const wxString& header)
: DPIDialog(nullptr, wxID_ANY, _L("Closing PrusaSlicer: Unsaved Changes"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
: DPIDialog((wxWindow*)wxGetApp().mainframe , wxID_ANY, _L("Closing PrusaSlicer: Unsaved Changes"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
m_app_config_key = "default_action_on_close_application";
@ -539,7 +539,7 @@ UnsavedChangesDialog::UnsavedChangesDialog(const wxString& header)
}
UnsavedChangesDialog::UnsavedChangesDialog(Preset::Type type, PresetCollection* dependent_presets, const std::string& new_selected_preset)
: DPIDialog(nullptr, wxID_ANY, _L("Switching Presets: Unsaved Changes"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
: DPIDialog((wxWindow*)wxGetApp().mainframe, wxID_ANY, _L("Switching Presets: Unsaved Changes"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
m_app_config_key = "default_action_on_select_preset";
@ -781,7 +781,7 @@ bool UnsavedChangesDialog::save(PresetCollection* dependent_presets)
// for system/default/external presets we should take an edited name
if (preset.is_system || preset.is_default || preset.is_external) {
SavePresetDialog save_dlg(preset.type);
SavePresetDialog save_dlg(this, preset.type);
if (save_dlg.ShowModal() != wxID_OK) {
m_exit_action = Action::Discard;
return false;
@ -809,7 +809,7 @@ bool UnsavedChangesDialog::save(PresetCollection* dependent_presets)
if (!types_for_save.empty()) {
SavePresetDialog save_dlg(types_for_save);
SavePresetDialog save_dlg(this, types_for_save);
if (save_dlg.ShowModal() != wxID_OK) {
m_exit_action = Action::Discard;
return false;