mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-11 02:57:39 +00:00
Merge branch 'main' into pr/Noisyfox/13712
This commit is contained in:
@@ -1337,7 +1337,7 @@ void AMSControl::ShowFilamentTip(bool hasams)
|
||||
//m_simplebook_right->SetSelection(0);
|
||||
if (hasams) {
|
||||
m_tip_right_top->Show();
|
||||
m_tip_load_info->SetLabelText(_L("Choose an AMS slot then press \"Load\" or \"Unload\" button to automatically load or unload filaments."));
|
||||
m_tip_load_info->SetLabelText(_L("Choose an AMS slot then press \"Load\" or \"Unload\" button to automatically load or unload filament."));
|
||||
} else {
|
||||
// m_tip_load_info->SetLabelText(_L("Before loading, please make sure the filament is pushed into toolhead."));
|
||||
m_tip_right_top->Hide();
|
||||
|
||||
@@ -30,7 +30,7 @@ FilamentLoad::FilamentLoad(wxWindow* parent, wxWindowID id, const wxPoint& pos,
|
||||
FILAMENT_CHANGE_STEP_STRING[FilamentStep::STEP_IDLE] = _L("Idling...");
|
||||
FILAMENT_CHANGE_STEP_STRING[FilamentStep::STEP_HEAT_NOZZLE] = _L("Heat the nozzle");
|
||||
FILAMENT_CHANGE_STEP_STRING[FilamentStep::STEP_CUT_FILAMENT] = _L("Cut filament");
|
||||
FILAMENT_CHANGE_STEP_STRING[FilamentStep::STEP_PULL_CURR_FILAMENT] = _L("Pull back current filament");
|
||||
FILAMENT_CHANGE_STEP_STRING[FilamentStep::STEP_PULL_CURR_FILAMENT] = _L("Pull back the current filament");
|
||||
FILAMENT_CHANGE_STEP_STRING[FilamentStep::STEP_PUSH_NEW_FILAMENT] = _L("Push new filament into extruder");
|
||||
FILAMENT_CHANGE_STEP_STRING[FilamentStep::STEP_GRAB_NEW_FILAMENT] = _L("Grab new filament");
|
||||
FILAMENT_CHANGE_STEP_STRING[FilamentStep::STEP_PURGE_OLD_FILAMENT] = _L("Purge old filament");
|
||||
|
||||
@@ -56,15 +56,22 @@ void SidePopup::Popup(wxWindow* focus)
|
||||
}
|
||||
if (focus) {
|
||||
wxPoint pos = focus->ClientToScreen(wxPoint(0, -6));
|
||||
int anchor_h = focus->GetSize().y + 12;
|
||||
|
||||
#ifdef __APPLE__
|
||||
pos.x = pos.x - FromDIP(20);
|
||||
// Orca #12936: since the wxWidgets 3.3 upgrade the transient popup is dismissed the
|
||||
// instant the cursor enters the gap between the button and the menu, making
|
||||
// "Print -> Export" unselectable. Anchor the menu flush against the button (slight
|
||||
// overlap) so there is no dead-zone for the cursor to cross.
|
||||
pos.y = focus->ClientToScreen(wxPoint(0, 0)).y;
|
||||
anchor_h = focus->GetSize().y - 2;
|
||||
#endif // __APPLE__
|
||||
|
||||
if (pos.x + max_width > screenwidth)
|
||||
Position({pos.x - (pos.x + max_width - screenwidth),pos.y}, {0, focus->GetSize().y + 12});
|
||||
Position({pos.x - (pos.x + max_width - screenwidth), pos.y}, {0, anchor_h});
|
||||
else
|
||||
Position(pos, {0, focus->GetSize().y + 12});
|
||||
Position(pos, {0, anchor_h});
|
||||
}
|
||||
Slic3r::GUI::wxGetApp().set_side_menu_popup_status(true);
|
||||
PopupWindow::Popup();
|
||||
|
||||
@@ -193,20 +193,18 @@ void StaticBox::doRender(wxDC& dc)
|
||||
if ((border_width && border_color.count() > 0) || background_color.count() > 0) {
|
||||
wxRect rc(0, 0, size.x, size.y);
|
||||
if (border_width && border_color.count() > 0) {
|
||||
if (dc.GetContentScaleFactor() == 1.0) {
|
||||
int d = floor(border_width / 2.0);
|
||||
int d2 = floor(border_width - 1);
|
||||
rc.x += d;
|
||||
rc.width -= d2;
|
||||
rc.y += d;
|
||||
rc.height -= d2;
|
||||
} else {
|
||||
int d = 1;
|
||||
rc.x += d;
|
||||
rc.width -= d;
|
||||
rc.y += d;
|
||||
rc.height -= d;
|
||||
}
|
||||
const double scale = dc.GetContentScaleFactor();
|
||||
|
||||
// Snap rect edges to physical pixel boundaries so the 1px pen doesn't straddle a pixel boundary
|
||||
auto snap = [&](int logical) -> int {
|
||||
return (int)(ceil(logical * scale) / scale);
|
||||
};
|
||||
|
||||
int deflate = snap(border_width / 2.0); // at 175%: snap(0.5) = snap→1/1.75 ≈ 1
|
||||
rc.x += deflate;
|
||||
rc.y += deflate;
|
||||
rc.width -= deflate * 2;
|
||||
rc.height -= deflate * 2;
|
||||
dc.SetPen(wxPen(border_color.colorForStates(states), border_width, border_style));
|
||||
} else {
|
||||
dc.SetPen(wxPen(background_color.colorForStates(states)));
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -62,6 +62,8 @@ public:
|
||||
void msw_rescale() { Rescale(); }
|
||||
|
||||
bool Enable(bool enable = true) override;
|
||||
void SetDevMode(bool enable = true);
|
||||
bool GetDevMode() const {return m_dev_mode;};
|
||||
|
||||
protected:
|
||||
void doRender(wxDC& dc) override;
|
||||
@@ -78,7 +80,8 @@ private:
|
||||
int m_selection { 0 };
|
||||
bool m_pressed { false };
|
||||
bool m_enabled { true };
|
||||
wxString m_tooltips[3];
|
||||
bool m_dev_mode { false };
|
||||
wxString m_tooltips[4];
|
||||
StateColor dot_active;
|
||||
StateColor dot_dimmed;
|
||||
StateColor text_color;
|
||||
|
||||
Reference in New Issue
Block a user