Merge remote-tracking branch 'upstream/main' into feedback

This commit is contained in:
Clifford Garwood
2026-05-01 01:30:40 -04:00
1033 changed files with 24477 additions and 1712 deletions
+27 -63
View File
@@ -44,7 +44,9 @@
#include "MsgDialog.hpp"
#include "Notebook.hpp"
#include "Widgets/ComboBox.hpp"
#include "Widgets/Label.hpp"
#include "Widgets/SwitchButton.hpp"
#include "Widgets/TabCtrl.hpp"
#include "Widgets/ComboBox.hpp"
#include "Widgets/CheckBox.hpp"
@@ -68,6 +70,16 @@ t_config_option_keys deep_diff(const ConfigBase &config_this, const ConfigBase &
namespace GUI {
namespace
{
int mode_to_selection(ConfigOptionMode mode)
{
return mode == comExpert ? 2 :
mode == comAdvanced ? 1 :
0;
}
}
#define DISABLE_UNDO_SYS
// Forward declaration for early use; definitions live later in this translation unit.
@@ -393,17 +405,19 @@ void Tab::create_preset_tab()
if (dynamic_cast<TabPrint*>(this) == nullptr) {
m_mode_icon = new ScalableButton(m_top_panel, wxID_ANY, "advanced"); // ORCA
m_mode_icon->SetToolTip(_L("Show/Hide advanced parameters"));
m_mode_icon->SetToolTip(_L("Cycle settings visibility"));
m_mode_icon->Bind(wxEVT_BUTTON, [this](wxCommandEvent e) {
if(wxGetApp().get_mode() == comDevelop) return; // prevent change on dev mode
m_mode_view->SetValue(!m_mode_view->GetValue());
wxCommandEvent evt(wxEVT_TOGGLEBUTTON, m_mode_view->GetId()); // ParamsPanel::OnToggled(evt)
evt.SetEventObject(m_mode_view);
m_mode_view->wxEvtHandler::ProcessEvent(evt);
if (wxGetApp().get_mode() == comDevelop || m_mode_view == nullptr)
return; // prevent change on dev mode
const int selection = m_mode_view->GetSelection();
m_mode_view->SelectAndNotify((selection + 1) % 3);
});
m_top_sizer->Add(m_mode_icon, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::WideSpacing()));
m_mode_view = new SwitchButton(m_top_panel, wxID_ABOUT);
m_mode_view->SetToolTip(_L("Show/Hide advanced parameters"));
m_mode_view = new ModeSwitchButton(m_top_panel);
m_mode_view->SetSelection(mode_to_selection(wxGetApp().get_saved_mode()));
if (wxGetApp().get_mode() == comDevelop)
m_mode_view->Enable(false);
m_top_sizer->AddSpacer(FromDIP(SidebarProps::ElementSpacing()));
m_top_sizer->Add( m_mode_view, 0, wxALIGN_CENTER_VERTICAL);
}
@@ -417,56 +431,6 @@ void Tab::create_preset_tab()
else
m_top_panel->Hide();
#if 0
#ifdef _MSW_DARK_MODE
// Sizer with buttons for mode changing
if (wxGetApp().tabs_as_menu())
#endif
m_mode_sizer = new ModeSizer(panel, int (0.5*em_unit(this)));
const float scale_factor = /*wxGetApp().*/em_unit(this)*0.1;// GetContentScaleFactor();
m_hsizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add(m_hsizer, 0, wxEXPAND | wxBOTTOM, 3);
m_hsizer->Add(m_presets_choice, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, 3);
m_hsizer->AddSpacer(int(4*scale_factor));
m_hsizer->Add(m_btn_save_preset, 0, wxALIGN_CENTER_VERTICAL);
m_hsizer->AddSpacer(int(4 * scale_factor));
m_hsizer->Add(m_btn_delete_preset, 0, wxALIGN_CENTER_VERTICAL);
if (m_btn_edit_ph_printer) {
m_hsizer->AddSpacer(int(4 * scale_factor));
m_hsizer->Add(m_btn_edit_ph_printer, 0, wxALIGN_CENTER_VERTICAL);
}
m_hsizer->AddSpacer(int(/*16*/8 * scale_factor));
m_hsizer->Add(m_btn_hide_incompatible_presets, 0, wxALIGN_CENTER_VERTICAL);
m_hsizer->AddSpacer(int(8 * scale_factor));
m_hsizer->Add(m_question_btn, 0, wxALIGN_CENTER_VERTICAL);
m_hsizer->AddSpacer(int(32 * scale_factor));
m_hsizer->Add(m_undo_to_sys_btn, 0, wxALIGN_CENTER_VERTICAL);
m_hsizer->Add(m_undo_btn, 0, wxALIGN_CENTER_VERTICAL);
m_hsizer->AddSpacer(int(32 * scale_factor));
m_hsizer->Add(m_search_btn, 0, wxALIGN_CENTER_VERTICAL);
m_hsizer->AddSpacer(int(8*scale_factor));
m_hsizer->Add(m_btn_compare_preset, 0, wxALIGN_CENTER_VERTICAL);
m_hsizer->AddSpacer(int(16*scale_factor));
// m_hsizer->AddStretchSpacer(32);
// StretchSpacer has a strange behavior under OSX, so
// There is used just additional sizer for m_mode_sizer with right alignment
if (m_mode_sizer) {
auto mode_sizer = new wxBoxSizer(wxVERTICAL);
// Don't set the 2nd parameter to 1, making the sizer rubbery scalable in Y axis may lead
// to wrong vertical size assigned to wxBitmapComboBoxes, see GH issue #7176.
mode_sizer->Add(m_mode_sizer, 0, wxALIGN_RIGHT);
m_hsizer->Add(mode_sizer, 1, wxALIGN_CENTER_VERTICAL | wxRIGHT, wxOSX ? 15 : 10);
}
//Horizontal sizer to hold the tree and the selected page.
m_hsizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add(m_hsizer, 1, wxEXPAND, 0);
//left vertical sizer
m_left_sizer = new wxBoxSizer(wxVERTICAL);
m_hsizer->Add(m_left_sizer, 0, wxEXPAND | wxLEFT | wxTOP | wxBOTTOM, 3);
#endif
// tree
m_tabctrl = new TabCtrl(panel, wxID_ANY, wxDefaultPosition, wxSize(20 * m_em_unit, -1),
wxTR_NO_BUTTONS | wxTR_HIDE_ROOT | wxTR_SINGLE | wxTR_NO_LINES | wxBORDER_NONE | wxWANTS_CHARS | wxTR_FULL_ROW_HIGHLIGHT);
@@ -1277,11 +1241,6 @@ void Tab::update_mode()
{
m_mode = wxGetApp().get_mode();
//BBS: GUI refactor
// update mode for ModeSizer
//if (m_mode_sizer)
// m_mode_sizer->SetMode(m_mode);
update_visibility();
update_changed_tree_ui();
@@ -1325,7 +1284,9 @@ void Tab::msw_rescale()
bmp->msw_rescale();
if (m_mode_view)
{
m_mode_view->Rescale();
}
if (m_detach_preset_btn)
m_detach_preset_btn->msw_rescale();
@@ -2330,6 +2291,7 @@ void TabPrint::build()
optgroup->append_single_option_line("xy_hole_compensation", "quality_settings_precision#x-y-compensation");
optgroup->append_single_option_line("xy_contour_compensation", "quality_settings_precision#x-y-compensation");
optgroup->append_single_option_line("elefant_foot_compensation", "quality_settings_precision#elephant-foot-compensation");
optgroup->append_single_option_line("elefant_foot_layers_density", "quality_settings_precision#elephant-foot-compensation");
optgroup->append_single_option_line("elefant_foot_compensation_layers", "quality_settings_precision#elephant-foot-compensation");
optgroup->append_single_option_line("precise_outer_wall", "quality_settings_precision#precise-wall");
optgroup->append_single_option_line("precise_z_height", "quality_settings_precision#precise-z-height");
@@ -2356,6 +2318,8 @@ void TabPrint::build()
optgroup->append_single_option_line("min_bead_width", "quality_settings_wall_generator#arachne");
optgroup->append_single_option_line("min_feature_size", "quality_settings_wall_generator#arachne");
optgroup->append_single_option_line("min_length_factor", "quality_settings_wall_generator#arachne");
optgroup->append_single_option_line("wall_maximum_resolution", "quality_settings_wall_generator#arachne");
optgroup->append_single_option_line("wall_maximum_deviation", "quality_settings_wall_generator#arachne");
optgroup = page->new_optgroup(L("Walls and surfaces"), L"param_wall_surface");
optgroup->append_single_option_line("wall_sequence", "quality_settings_wall_and_surfaces#walls-printing-order");