From 0f85777a799f36185c727b24dd7930a2a73c941f Mon Sep 17 00:00:00 2001 From: YuSanka Date: Fri, 16 Oct 2020 13:19:59 +0200 Subject: [PATCH] UnsavedChangesDialog: Updated icons on "Discard" buttons + Put "exit" icon on "Quit" menu item --- resources/icons/exit.svg | 27 +++++-------- resources/icons/switch_presets.svg | 52 +++++++++++++++++++++++++ src/slic3r/GUI/MainFrame.cpp | 2 +- src/slic3r/GUI/UnsavedChangesDialog.cpp | 4 +- 4 files changed, 65 insertions(+), 20 deletions(-) create mode 100644 resources/icons/switch_presets.svg diff --git a/resources/icons/exit.svg b/resources/icons/exit.svg index eca78da62..30091b381 100644 --- a/resources/icons/exit.svg +++ b/resources/icons/exit.svg @@ -1,20 +1,13 @@ - - - - + + + + - + diff --git a/resources/icons/switch_presets.svg b/resources/icons/switch_presets.svg new file mode 100644 index 000000000..a5f3fbefb --- /dev/null +++ b/resources/icons/switch_presets.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 4e6fb7306..202ead404 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -1139,7 +1139,7 @@ void MainFrame::init_menubar() [this](wxCommandEvent&) { start_new_gcodeviewer_open_file(this); }, "", nullptr); fileMenu->AppendSeparator(); append_menu_item(fileMenu, wxID_EXIT, _L("&Quit"), wxString::Format(_L("Quit %s"), SLIC3R_APP_NAME), - [this](wxCommandEvent&) { Close(false); }); + [this](wxCommandEvent&) { Close(false); }, "exit"); } #if !ENABLE_GCODE_VIEWER diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp index 7d787aa9c..b24f2758b 100644 --- a/src/slic3r/GUI/UnsavedChangesDialog.cpp +++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp @@ -546,7 +546,7 @@ UnsavedChangesDialog::UnsavedChangesDialog(Preset::Type type, PresetCollection* const std::string& def_action = wxGetApp().app_config->get(m_app_config_key); if (def_action == "none") { - if (wxGetApp().mainframe->is_dlg_layout()) + if (wxGetApp().mainframe->is_dlg_layout() && wxGetApp().mainframe->m_settings_dialog.HasFocus()) this->SetPosition(wxGetApp().mainframe->m_settings_dialog.GetPosition()); this->CenterOnScreen(); } @@ -637,7 +637,7 @@ void UnsavedChangesDialog::build(Preset::Type type, PresetCollection* dependent_ dependent_presets->get_edited_preset().printer_technology() == dependent_presets->find_preset(new_selected_preset)->printer_technology() : printers.get_edited_preset().printer_technology() == printers.find_preset(new_selected_preset)->printer_technology())) add_btn(&m_transfer_btn, m_move_btn_id, "paste_menu", Action::Transfer, _L("Transfer")); - add_btn(&m_discard_btn, m_continue_btn_id, dependent_presets ? "cross" : "exit", Action::Discard, _L("Discard"), false); + add_btn(&m_discard_btn, m_continue_btn_id, dependent_presets ? "switch_presets" : "exit", Action::Discard, _L("Discard"), false); add_btn(&m_save_btn, m_save_btn_id, "save", Action::Save, _L("Save")); ScalableButton* cancel_btn = new ScalableButton(this, wxID_CANCEL, "cross", _L("Cancel"), wxDefaultSize, wxDefaultPosition, wxBORDER_DEFAULT, true, 24);