Merge branch 'main' into pr/Noisyfox/13712

This commit is contained in:
SoftFever
2026-06-22 10:56:11 +08:00
2782 changed files with 331956 additions and 215963 deletions

View File

@@ -262,6 +262,7 @@ ModeSwitchButton::ModeSwitchButton(wxWindow* parent, wxWindowID id)
m_tooltips[0] = _L("Simple settings");
m_tooltips[1] = _L("Advanced settings");
m_tooltips[2] = _L("Expert settings");
m_tooltips[3] = _L("Developer mode") + "\n" + _L("Launch troubleshoot center") + "...";
Bind(wxEVT_LEFT_DOWN, &ModeSwitchButton::mouseDown, this);
Bind(wxEVT_LEFT_UP, &ModeSwitchButton::mouseReleased, this);
@@ -280,7 +281,7 @@ void ModeSwitchButton::SetSelection(int selection)
void ModeSwitchButton::SelectAndNotify(int selection)
{
if (!IsEnabled())
if (m_dev_mode || !IsEnabled())
return;
SetSelection(selection);
@@ -310,6 +311,15 @@ bool ModeSwitchButton::Enable(bool enable /* = true */)
return changed;
}
void ModeSwitchButton::SetDevMode(bool enable /* = true */)
{
if (enable != m_dev_mode){
m_dev_mode = enable;
update_tooltip();
Refresh();
}
}
void ModeSwitchButton::doRender(wxDC& dc)
{
const wxRect bounds = GetClientRect();
@@ -328,7 +338,7 @@ void ModeSwitchButton::doRender(wxDC& dc)
dc.SetBrush(wxBrush(background_color.colorForStates(states)));
dc.DrawRoundedRectangle(bounds, v_center);
if (m_enabled) {
if (!m_dev_mode) {
double dot_dist = (bounds.width - bounds.height) * 0.50;
// Track
@@ -368,6 +378,11 @@ void ModeSwitchButton::doRender(wxDC& dc)
void ModeSwitchButton::mouseDown(wxMouseEvent& event)
{
if (m_dev_mode){
Slic3r::GUI::wxGetApp().troubleshoot();
return;
}
if (!IsEnabled()) {
event.Skip();
return;
@@ -425,7 +440,10 @@ wxRect ModeSwitchButton::thumb_rect_for(int selection) const
void ModeSwitchButton::update_tooltip()
{
SetToolTip(m_tooltips[m_selection]);
if (m_dev_mode)
SetToolTip(m_tooltips[3]);
else
SetToolTip(m_tooltips[m_selection]);
}
SwitchBoard::SwitchBoard(wxWindow *parent, wxString leftL, wxString right, wxSize size)