From 1b698ce42eb4b57ff924fc6134b54e5aca98301a Mon Sep 17 00:00:00 2001 From: 76Octane <132669596+76Octane@users.noreply.github.com> Date: Mon, 14 Aug 2023 19:31:09 +0800 Subject: [PATCH] Add infill icons --- resources/icons/param_3d honeycomb.svg | 45 ++++ resources/icons/param_adaptive cubic.svg | 213 ++++++++++++++++++ resources/icons/param_aligned rectilinear.svg | 20 ++ resources/icons/param_archimedean chords.svg | 34 +++ resources/icons/param_concentric.svg | 20 ++ resources/icons/param_cubic.svg | 208 +++++++++++++++++ resources/icons/param_grid.svg | 32 +++ resources/icons/param_gyroid.svg | 46 ++++ resources/icons/param_hilbert curve.svg | 36 +++ resources/icons/param_honeycomb.svg | 45 ++++ resources/icons/param_lightning.svg | 45 ++++ resources/icons/param_line.svg | 58 +++++ resources/icons/param_octagram spiral.svg | 38 ++++ resources/icons/param_rectilinear.svg | 66 ++++++ resources/icons/param_stars.svg | 57 +++++ resources/icons/param_support cubic.svg | 213 ++++++++++++++++++ resources/icons/param_triangles.svg | 54 +++++ src/slic3r/GUI/Field.cpp | 21 +- 18 files changed, 1249 insertions(+), 2 deletions(-) create mode 100644 resources/icons/param_3d honeycomb.svg create mode 100644 resources/icons/param_adaptive cubic.svg create mode 100644 resources/icons/param_aligned rectilinear.svg create mode 100644 resources/icons/param_archimedean chords.svg create mode 100644 resources/icons/param_concentric.svg create mode 100644 resources/icons/param_cubic.svg create mode 100644 resources/icons/param_grid.svg create mode 100644 resources/icons/param_gyroid.svg create mode 100644 resources/icons/param_hilbert curve.svg create mode 100644 resources/icons/param_honeycomb.svg create mode 100644 resources/icons/param_lightning.svg create mode 100644 resources/icons/param_line.svg create mode 100644 resources/icons/param_octagram spiral.svg create mode 100644 resources/icons/param_rectilinear.svg create mode 100644 resources/icons/param_stars.svg create mode 100644 resources/icons/param_support cubic.svg create mode 100644 resources/icons/param_triangles.svg diff --git a/resources/icons/param_3d honeycomb.svg b/resources/icons/param_3d honeycomb.svg new file mode 100644 index 0000000..6349bf1 --- /dev/null +++ b/resources/icons/param_3d honeycomb.svg @@ -0,0 +1,45 @@ + + Created by potrace 1.10, written by Peter Selinger 2001-2011 diff --git a/resources/icons/param_adaptive cubic.svg b/resources/icons/param_adaptive cubic.svg new file mode 100644 index 0000000..2fe2485 --- /dev/null +++ b/resources/icons/param_adaptive cubic.svg @@ -0,0 +1,213 @@ + + + + + Created by potrace 1.10, written by Peter Selinger 2001-2011 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/icons/param_aligned rectilinear.svg b/resources/icons/param_aligned rectilinear.svg new file mode 100644 index 0000000..d6045b6 --- /dev/null +++ b/resources/icons/param_aligned rectilinear.svg @@ -0,0 +1,20 @@ + + + + +Created by potrace 1.10, written by Peter Selinger 2001-2011 + + + + + diff --git a/resources/icons/param_archimedean chords.svg b/resources/icons/param_archimedean chords.svg new file mode 100644 index 0000000..f2a3034 --- /dev/null +++ b/resources/icons/param_archimedean chords.svg @@ -0,0 +1,34 @@ + + + + +Created by potrace 1.10, written by Peter Selinger 2001-2011 + + + + + diff --git a/resources/icons/param_concentric.svg b/resources/icons/param_concentric.svg new file mode 100644 index 0000000..2655e8e --- /dev/null +++ b/resources/icons/param_concentric.svg @@ -0,0 +1,20 @@ + + + + +Created by potrace 1.10, written by Peter Selinger 2001-2011 + + + + + + + diff --git a/resources/icons/param_cubic.svg b/resources/icons/param_cubic.svg new file mode 100644 index 0000000..89c0b41 --- /dev/null +++ b/resources/icons/param_cubic.svg @@ -0,0 +1,208 @@ + + + + + Created by potrace 1.10, written by Peter Selinger 2001-2011 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/icons/param_grid.svg b/resources/icons/param_grid.svg new file mode 100644 index 0000000..004b725 --- /dev/null +++ b/resources/icons/param_grid.svg @@ -0,0 +1,32 @@ + + + + +Created by potrace 1.10, written by Peter Selinger 2001-2011 + + + + + diff --git a/resources/icons/param_gyroid.svg b/resources/icons/param_gyroid.svg new file mode 100644 index 0000000..c619659 --- /dev/null +++ b/resources/icons/param_gyroid.svg @@ -0,0 +1,46 @@ + + Created by potrace 1.10, written by Peter Selinger 2001-2011 diff --git a/resources/icons/param_hilbert curve.svg b/resources/icons/param_hilbert curve.svg new file mode 100644 index 0000000..233003d --- /dev/null +++ b/resources/icons/param_hilbert curve.svg @@ -0,0 +1,36 @@ + + + + +Created by potrace 1.10, written by Peter Selinger 2001-2011 + + + + + diff --git a/resources/icons/param_honeycomb.svg b/resources/icons/param_honeycomb.svg new file mode 100644 index 0000000..5055dd1 --- /dev/null +++ b/resources/icons/param_honeycomb.svg @@ -0,0 +1,45 @@ + + + + +Created by potrace 1.10, written by Peter Selinger 2001-2011 + + + + + diff --git a/resources/icons/param_lightning.svg b/resources/icons/param_lightning.svg new file mode 100644 index 0000000..97635a6 --- /dev/null +++ b/resources/icons/param_lightning.svg @@ -0,0 +1,45 @@ + + + + +Created by potrace 1.10, written by Peter Selinger 2001-2011 + + + + + diff --git a/resources/icons/param_line.svg b/resources/icons/param_line.svg new file mode 100644 index 0000000..1524b85 --- /dev/null +++ b/resources/icons/param_line.svg @@ -0,0 +1,58 @@ + + + + +Created by potrace 1.10, written by Peter Selinger 2001-2011 + + + + + diff --git a/resources/icons/param_octagram spiral.svg b/resources/icons/param_octagram spiral.svg new file mode 100644 index 0000000..074cdd4 --- /dev/null +++ b/resources/icons/param_octagram spiral.svg @@ -0,0 +1,38 @@ + + + + +Created by potrace 1.10, written by Peter Selinger 2001-2011 + + + + + diff --git a/resources/icons/param_rectilinear.svg b/resources/icons/param_rectilinear.svg new file mode 100644 index 0000000..a64e128 --- /dev/null +++ b/resources/icons/param_rectilinear.svg @@ -0,0 +1,66 @@ + + + + + Created by potrace 1.10, written by Peter Selinger 2001-2011 + + + + + + + diff --git a/resources/icons/param_stars.svg b/resources/icons/param_stars.svg new file mode 100644 index 0000000..d1fb711 --- /dev/null +++ b/resources/icons/param_stars.svg @@ -0,0 +1,57 @@ + + + + +Created by potrace 1.10, written by Peter Selinger 2001-2011 + + + + + diff --git a/resources/icons/param_support cubic.svg b/resources/icons/param_support cubic.svg new file mode 100644 index 0000000..2fe2485 --- /dev/null +++ b/resources/icons/param_support cubic.svg @@ -0,0 +1,213 @@ + + + + + Created by potrace 1.10, written by Peter Selinger 2001-2011 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/icons/param_triangles.svg b/resources/icons/param_triangles.svg new file mode 100644 index 0000000..47b229f --- /dev/null +++ b/resources/icons/param_triangles.svg @@ -0,0 +1,54 @@ + + + + +Created by potrace 1.10, written by Peter Selinger 2001-2011 + + + + + diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index 6542016..5b24f8a 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -1019,14 +1019,31 @@ void Choice::BUILD() { // recast as a wxWindow to fit the calling convention window = dynamic_cast(temp); - if (m_opt.enum_def) { + /*if (m_opt.enum_def) { if (auto& labels = m_opt.enum_def->labels(); !labels.empty()) { bool localized = m_opt.enum_def->has_labels(); for (const std::string& el : labels) temp->Append(localized ? _(from_u8(el)) : from_u8(el)); set_selection(); } - } + }*/ + if (m_opt.enum_def) { + // Append localized enum_labels + int i = 0; + boost::filesystem::path image_path(Slic3r::resources_dir()); + image_path /= "icons"; + for (auto el : m_opt.enum_def->labels()) { + auto icon_name = "param_" + m_opt.enum_def->labels()[i]; + if (boost::filesystem::exists(image_path / (icon_name + ".svg"))) { + ScalableBitmap bm(temp, icon_name, 24); + temp->Append(_(el), bm.bmp()); + } else { + temp->Append(_(el)); + } + ++i; + } + set_selection(); + } temp->Bind(wxEVT_MOUSEWHEEL, [this](wxMouseEvent& e) { if (m_suppress_scroll && !m_is_dropped)