From 1e459781478346c223eeda26d2da729f5764a567 Mon Sep 17 00:00:00 2001 From: Maeyanie Date: Sat, 31 Jan 2026 21:04:51 -0500 Subject: [PATCH] Refactor following yw4z's feedback --- src/slic3r/GUI/Preferences.cpp | 8 ++++---- src/slic3r/GUI/Preferences.hpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/Preferences.cpp b/src/slic3r/GUI/Preferences.cpp index b8d72f24f1..6f01f8d618 100644 --- a/src/slic3r/GUI/Preferences.cpp +++ b/src/slic3r/GUI/Preferences.cpp @@ -557,7 +557,7 @@ wxBoxSizer *PreferencesDialog::create_item_input(wxString title, wxString title2 return sizer_input; } -wxBoxSizer *PreferencesDialog::create_item_spinctrl(wxString title, wxString title2, wxString title3, wxString tooltip, std::string param, +wxBoxSizer *PreferencesDialog::create_item_spinctrl(wxString title, wxString title2, wxString side_label, wxString tooltip, std::string param, int min, int max, std::function onchange) { wxBoxSizer *sizer_input = new wxBoxSizer(wxHORIZONTAL); @@ -567,13 +567,13 @@ wxBoxSizer *PreferencesDialog::create_item_spinctrl(wxString title, wxString tit input_title->SetToolTip(tooltip); input_title->Wrap(DESIGN_TITLE_SIZE.x); - auto input = new ::SpinInput(m_parent, wxEmptyString, title2, wxDefaultPosition, DESIGN_INPUT_SIZE, wxSP_ARROW_KEYS, + auto input = new ::SpinInput(m_parent, wxEmptyString, side_label, wxDefaultPosition, DESIGN_INPUT_SIZE, wxSP_ARROW_KEYS, min, max, stoi(app_config->get(param))); StateColor input_bg(std::pair(wxColour("#F0F0F1"), StateColor::Disabled), std::pair(*wxWHITE, StateColor::Enabled)); input->SetBackgroundColor(input_bg); input->SetToolTip(tooltip); - auto second_title = new wxStaticText(m_parent, wxID_ANY, title3, wxDefaultPosition, wxDefaultSize, 0); + auto second_title = new wxStaticText(m_parent, wxID_ANY, title2, wxDefaultPosition, wxDefaultSize, 0); second_title->SetForegroundColour(DESIGN_GRAY900_COLOR); second_title->SetFont(::Label::Body_14); second_title->SetToolTip(tooltip); @@ -1361,8 +1361,8 @@ void PreferencesDialog::create_items() #endif auto item_draco_position_bits = create_item_spinctrl(_L("Draco dimensional accuracy on export"), - _L("bits"), wxEmptyString, + _L("bits"), _L("0 bits disables quantization producing an effectively lossless but compressed file.\n" "~16 bits may be recommended and within the tolerances of 3D printing.\n" "More bits results in better quality and dimensional accuracy but larger file size.\n"), diff --git a/src/slic3r/GUI/Preferences.hpp b/src/slic3r/GUI/Preferences.hpp index 144b111290..c46c724702 100644 --- a/src/slic3r/GUI/Preferences.hpp +++ b/src/slic3r/GUI/Preferences.hpp @@ -91,7 +91,7 @@ public: wxBoxSizer *create_item_button(wxString title, wxString title2, wxString tooltip, wxString tooltip2, std::function onclick); wxBoxSizer *create_item_downloads(wxString title, wxString tooltip); wxBoxSizer *create_item_input(wxString title, wxString title2, wxString tooltip, std::string param, std::function onchange = {}); - wxBoxSizer *create_item_spinctrl(wxString title, wxString title2, wxString title3, wxString tooltip, std::string param, int min, int max, std::function onchange = nullptr); + wxBoxSizer *create_item_spinctrl(wxString title, wxString title2, wxString side_label, wxString tooltip, std::string param, int min, int max, std::function onchange = nullptr); wxBoxSizer *create_camera_orbit_mult_input(wxString title, wxString tooltip); wxBoxSizer *create_item_backup(wxString title, wxString tooltip); wxBoxSizer *create_item_auto_reslice(wxString title, wxString checkbox_tooltip, wxString delay_tooltip);