diff --git a/resources/icons/cross.svg b/resources/icons/cross.svg new file mode 100644 index 000000000..96835d259 --- /dev/null +++ b/resources/icons/cross.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + diff --git a/resources/icons/flag_green.svg b/resources/icons/flag_green.svg new file mode 100644 index 000000000..90932e5e4 --- /dev/null +++ b/resources/icons/flag_green.svg @@ -0,0 +1,10 @@ + + + + + + + + + diff --git a/resources/icons/flag_red.svg b/resources/icons/flag_red.svg new file mode 100644 index 000000000..8d39a9d6a --- /dev/null +++ b/resources/icons/flag_red.svg @@ -0,0 +1,10 @@ + + + + + + + + + diff --git a/resources/icons/layers_white.svg b/resources/icons/layers_white.svg new file mode 100644 index 000000000..cd71fab3a --- /dev/null +++ b/resources/icons/layers_white.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/icons/lock_closed.svg b/resources/icons/lock_closed.svg new file mode 100644 index 000000000..549cdba23 --- /dev/null +++ b/resources/icons/lock_closed.svg @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/resources/icons/lock_closed_white.svg b/resources/icons/lock_closed_white.svg new file mode 100644 index 000000000..1665dc9a0 --- /dev/null +++ b/resources/icons/lock_closed_white.svg @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/resources/icons/lock_open.svg b/resources/icons/lock_open.svg new file mode 100644 index 000000000..047e8685c --- /dev/null +++ b/resources/icons/lock_open.svg @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/resources/icons/question.svg b/resources/icons/question.svg new file mode 100644 index 000000000..5463243c6 --- /dev/null +++ b/resources/icons/question.svg @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/resources/icons/resin.svg b/resources/icons/resin.svg new file mode 100644 index 000000000..da44606a0 --- /dev/null +++ b/resources/icons/resin.svg @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/resources/icons/save.svg b/resources/icons/save.svg new file mode 100644 index 000000000..9e3fb961e --- /dev/null +++ b/resources/icons/save.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/icons/undo.svg b/resources/icons/undo.svg new file mode 100644 index 000000000..fbc580d88 --- /dev/null +++ b/resources/icons/undo.svg @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/src/libslic3r/SLAPrint.cpp b/src/libslic3r/SLAPrint.cpp index d973ca156..e5a574463 100644 --- a/src/libslic3r/SLAPrint.cpp +++ b/src/libslic3r/SLAPrint.cpp @@ -1654,16 +1654,16 @@ Vec3d SLAPrint::relative_correction() const { Vec3d corr(1., 1., 1.); - if(printer_config().relative_correction.values.size() == 3) { - corr(X) = printer_config().relative_correction.values[X]; - corr(Y) = printer_config().relative_correction.values[Y]; - corr(Z) = printer_config().relative_correction.values[Z]; + if(printer_config().relative_correction.values.size() == 2) { + corr(X) = printer_config().relative_correction.values[0]; + corr(Y) = printer_config().relative_correction.values[0]; + corr(Z) = printer_config().relative_correction.values[1]; } - if(material_config().material_correction.values.size() == 3) { - corr(X) *= material_config().material_correction.values[X]; - corr(Y) *= material_config().material_correction.values[Y]; - corr(Z) *= material_config().material_correction.values[Z]; + if(material_config().material_correction.values.size() == 2) { + corr(X) *= material_config().material_correction.values[0]; + corr(Y) *= material_config().material_correction.values[0]; + corr(Z) *= material_config().material_correction.values[1]; } return corr; diff --git a/src/slic3r/GUI/GUI_ObjectSettings.cpp b/src/slic3r/GUI/GUI_ObjectSettings.cpp index f1e326caf..72eeb76de 100644 --- a/src/slic3r/GUI/GUI_ObjectSettings.cpp +++ b/src/slic3r/GUI/GUI_ObjectSettings.cpp @@ -77,7 +77,7 @@ void ObjectSettings::update_settings_list() { auto opt_key = (line.get_options())[0].opt_id; //we assume that we have one option per line - auto btn = new wxBitmapButton(parent, wxID_ANY, create_scaled_bitmap(m_parent, "colorchange_delete_on.png"), + auto btn = new wxBitmapButton(parent, wxID_ANY, create_scaled_bitmap(m_parent, "cross"/*"colorchange_delete_on.png"*/), wxDefaultPosition, wxDefaultSize, wxBORDER_NONE); #ifdef __WXMSW__ btn->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 059d04f85..b68027178 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -61,7 +61,7 @@ DPIFrame(NULL, wxID_ANY, SLIC3R_BUILD, wxDefaultPosition, wxDefaultSize, wxDEFAU /* Load default preset bitmaps before a tabpanel initialization, * but after filling of an em_unit value */ - wxGetApp().preset_bundle->load_default_preset_bitmaps(); + wxGetApp().preset_bundle->load_default_preset_bitmaps(this); // initialize tabpanel and menubar init_tabpanel(); @@ -273,9 +273,9 @@ void MainFrame::init_menubar() wxMenuItem* item_open = append_menu_item(fileMenu, wxID_ANY, _(L("&Open Project")) + dots + "\tCtrl+O", _(L("Open a project file")), [this](wxCommandEvent&) { if (m_plater) m_plater->load_project(); }, "brick_add.png"); wxMenuItem* item_save = append_menu_item(fileMenu, wxID_ANY, _(L("&Save Project")) + "\tCtrl+S", _(L("Save current project file")), - [this](wxCommandEvent&) { if (m_plater) m_plater->export_3mf(into_path(m_plater->get_project_filename())); }, "disk.png"); + [this](wxCommandEvent&) { if (m_plater) m_plater->export_3mf(into_path(m_plater->get_project_filename())); }, "save"); wxMenuItem* item_save_as = append_menu_item(fileMenu, wxID_ANY, _(L("Save Project &as")) + dots + "\tCtrl+Alt+S", _(L("Save current project file as")), - [this](wxCommandEvent&) { if (m_plater) m_plater->export_3mf(); }, "disk.png"); + [this](wxCommandEvent&) { if (m_plater) m_plater->export_3mf(); }, "save"); fileMenu->AppendSeparator(); diff --git a/src/slic3r/GUI/Preset.cpp b/src/slic3r/GUI/Preset.cpp index df4500d0c..97c42d7fb 100644 --- a/src/slic3r/GUI/Preset.cpp +++ b/src/slic3r/GUI/Preset.cpp @@ -799,16 +799,14 @@ bool PresetCollection::delete_current_preset() return true; } -void PresetCollection::load_bitmap_default(const std::string &file_name) +void PresetCollection::load_bitmap_default(wxWindow *window, const std::string &file_name) { - // FIXME: pass window ptr for proper scaling - *m_bitmap_main_frame = create_scaled_bitmap(nullptr, file_name); + *m_bitmap_main_frame = create_scaled_bitmap(window, file_name); } -void PresetCollection::load_bitmap_add(const std::string &file_name) +void PresetCollection::load_bitmap_add(wxWindow *window, const std::string &file_name) { - // FIXME: pass window ptr for proper scaling - *m_bitmap_add = create_scaled_bitmap(nullptr, file_name); + *m_bitmap_add = create_scaled_bitmap(window, file_name); } const Preset* PresetCollection::get_selected_preset_parent() const diff --git a/src/slic3r/GUI/Preset.hpp b/src/slic3r/GUI/Preset.hpp index 22740e31e..41c9ff72b 100644 --- a/src/slic3r/GUI/Preset.hpp +++ b/src/slic3r/GUI/Preset.hpp @@ -15,6 +15,7 @@ class wxBitmapComboBox; class wxChoice; class wxItemContainer; class wxString; +class wxWindow; namespace Slic3r { @@ -276,10 +277,10 @@ public: bool delete_current_preset(); // Load default bitmap to be placed at the wxBitmapComboBox of a MainFrame. - void load_bitmap_default(const std::string &file_name); + void load_bitmap_default(wxWindow *window, const std::string &file_name); // Load "add new printer" bitmap to be placed at the wxBitmapComboBox of a MainFrame. - void load_bitmap_add(const std::string &file_name); + void load_bitmap_add(wxWindow *window, const std::string &file_name); // Compatible & incompatible marks, to be placed at the wxBitmapComboBox items. void set_bitmap_compatible (const wxBitmap *bmp) { m_bitmap_compatible = bmp; } diff --git a/src/slic3r/GUI/PresetBundle.cpp b/src/slic3r/GUI/PresetBundle.cpp index 6bf72675d..ad7829b2c 100644 --- a/src/slic3r/GUI/PresetBundle.cpp +++ b/src/slic3r/GUI/PresetBundle.cpp @@ -396,13 +396,12 @@ void PresetBundle::export_selections(AppConfig &config) config.set("presets", "printer", printers.get_selected_preset_name()); } -void PresetBundle::load_compatible_bitmaps() +void PresetBundle::load_compatible_bitmaps(wxWindow *window) { - // FIXME: pass window ptr for proper scaling - *m_bitmapCompatible = create_scaled_bitmap(nullptr, "flag-green-icon.png"); - *m_bitmapIncompatible = create_scaled_bitmap(nullptr, "flag-red-icon.png"); - *m_bitmapLock = create_scaled_bitmap(nullptr, "sys_lock.png"); - *m_bitmapLockOpen = create_scaled_bitmap(nullptr, "sys_unlock.png"); + *m_bitmapCompatible = create_scaled_bitmap(window, "flag_green"); + *m_bitmapIncompatible = create_scaled_bitmap(window, "flag_red"); + *m_bitmapLock = create_scaled_bitmap(window, "lock_closed"); + *m_bitmapLockOpen = create_scaled_bitmap(window, "sys_unlock.png"); prints .set_bitmap_compatible(m_bitmapCompatible); filaments .set_bitmap_compatible(m_bitmapCompatible); @@ -1428,15 +1427,15 @@ bool PresetBundle::parse_color(const std::string &scolor, unsigned char *rgb_out return true; } -void PresetBundle::load_default_preset_bitmaps() +void PresetBundle::load_default_preset_bitmaps(wxWindow *window) { - this->prints.load_bitmap_default("cog"); - this->sla_prints.load_bitmap_default("cog"); - this->filaments.load_bitmap_default("spool.png"); - this->sla_materials.load_bitmap_default("package_green.png"); - this->printers.load_bitmap_default("printer"); - this->printers.load_bitmap_add("add.png"); - this->load_compatible_bitmaps(); + this->prints.load_bitmap_default(window, "cog"); + this->sla_prints.load_bitmap_default(window, "cog"); + this->filaments.load_bitmap_default(window, "spool.png"); + this->sla_materials.load_bitmap_default(window, "resin"); + this->printers.load_bitmap_default(window, "printer"); + this->printers.load_bitmap_add(window, "add.png"); + this->load_compatible_bitmaps(window); } void PresetBundle::update_platter_filament_ui(unsigned int idx_extruder, GUI::PresetComboBox *ui) diff --git a/src/slic3r/GUI/PresetBundle.hpp b/src/slic3r/GUI/PresetBundle.hpp index 1f627d045..069ebd784 100644 --- a/src/slic3r/GUI/PresetBundle.hpp +++ b/src/slic3r/GUI/PresetBundle.hpp @@ -7,6 +7,8 @@ #include #include +class wxWindow; + namespace Slic3r { namespace GUI { @@ -127,7 +129,7 @@ public: static bool parse_color(const std::string &scolor, unsigned char *rgb_out); - void load_default_preset_bitmaps(); + void load_default_preset_bitmaps(wxWindow *window); private: std::string load_system_presets(); @@ -148,7 +150,7 @@ private: // If it is not an external config, then the config will be stored into the user profile directory. void load_config_file_config(const std::string &name_or_path, bool is_external, DynamicPrintConfig &&config); void load_config_file_config_bundle(const std::string &path, const boost::property_tree::ptree &tree); - void load_compatible_bitmaps(); + void load_compatible_bitmaps(wxWindow *window); DynamicPrintConfig full_fff_config() const; DynamicPrintConfig full_sla_config() const; diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index e5b83587e..c735a40ee 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -116,16 +116,16 @@ void Tab::create_preset_tab() //buttons wxBitmap bmpMenu; - bmpMenu = create_scaled_bitmap(this, "disk.png"); + bmpMenu = create_scaled_bitmap(this, "save"); m_btn_save_preset = new wxBitmapButton(panel, wxID_ANY, bmpMenu, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE); if (wxMSW) m_btn_save_preset->SetBackgroundColour(color); - bmpMenu = create_scaled_bitmap(this, "delete.png"); + bmpMenu = create_scaled_bitmap(this, "cross"/*"delete.png"*/); m_btn_delete_preset = new wxBitmapButton(panel, wxID_ANY, bmpMenu, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE); if (wxMSW) m_btn_delete_preset->SetBackgroundColour(color); m_show_incompatible_presets = false; - m_bmp_show_incompatible_presets = create_scaled_bitmap(this, "flag-red-icon.png"); - m_bmp_hide_incompatible_presets = create_scaled_bitmap(this, "flag-green-icon.png"); + m_bmp_show_incompatible_presets = create_scaled_bitmap(this, "flag_red"); + m_bmp_hide_incompatible_presets = create_scaled_bitmap(this, "flag_green"); m_btn_hide_incompatible_presets = new wxBitmapButton(panel, wxID_ANY, m_bmp_hide_incompatible_presets, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE); if (wxMSW) m_btn_hide_incompatible_presets->SetBackgroundColour(color); @@ -148,13 +148,13 @@ void Tab::create_preset_tab() // Determine the theme color of OS (dark or light) auto luma = wxGetApp().get_colour_approx_luma(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); // Bitmaps to be shown on the "Revert to system" aka "Lock to system" button next to each input field. - m_bmp_value_lock = create_scaled_bitmap(this, "sys_lock.png"); - m_bmp_value_unlock = create_scaled_bitmap(this, luma >= 128 ? "sys_unlock.png" : "sys_unlock_grey.png"); + m_bmp_value_lock = create_scaled_bitmap(this, luma >= 128 ? "lock_closed" : "lock_closed_white"); + m_bmp_value_unlock = create_scaled_bitmap(this, "lock_open"); m_bmp_non_system = &m_bmp_white_bullet; // Bitmaps to be shown on the "Undo user changes" button next to each input field. - m_bmp_value_revert = create_scaled_bitmap(this, luma >= 128 ? "action_undo.png" : "action_undo_grey.png"); + m_bmp_value_revert = create_scaled_bitmap(this, "undo"); m_bmp_white_bullet = create_scaled_bitmap(this, "bullet_white.png"); - m_bmp_question = create_scaled_bitmap(this, "question_mark_01.png"); + m_bmp_question = create_scaled_bitmap(this, "question"); fill_icon_descriptions(); set_tooltips_text(); @@ -2007,7 +2007,8 @@ void TabPrinter::build_sla() optgroup = page->new_optgroup(_(L("Corrections"))); line = Line{ m_config->def()->get("relative_correction")->full_label, "" }; - std::vector axes{ "X", "Y", "Z" }; +// std::vector axes{ "X", "Y", "Z" }; + std::vector axes{ "XY", "Z" }; int id = 0; for (auto& axis : axes) { auto opt = optgroup->get_option("relative_correction", id); @@ -3210,7 +3211,7 @@ void TabSLAMaterial::build() m_presets = &m_preset_bundle->sla_materials; load_initial_data(); - auto page = add_options_page(_(L("Material")), "package_green.png"); + auto page = add_options_page(_(L("Material")), "resin"); auto optgroup = page->new_optgroup(_(L("Layers"))); // optgroup->append_single_option_line("layer_height"); diff --git a/src/slic3r/GUI/wxExtensions.cpp b/src/slic3r/GUI/wxExtensions.cpp index 100b02253..7f5b5ad9c 100644 --- a/src/slic3r/GUI/wxExtensions.cpp +++ b/src/slic3r/GUI/wxExtensions.cpp @@ -426,7 +426,12 @@ wxBitmap create_scaled_bitmap(wxWindow *win, const std::string& bmp_name_in, con { static Slic3r::GUI::BitmapCache cache; +#ifdef __APPLE__ const float scale_factor = win != nullptr ? win->GetContentScaleFactor() : 1.0f; +#else + (void)(win); + const float scale_factor = 1.0f; +#endif unsigned int height, width = height = 0; unsigned int& scale_base = is_horizontal ? width : height;