FIX:amsmappingpop dialog adjustments on macos

Change-Id: Ideeb1b8536efeaf0fedefa0acf91c386a2c76b96
This commit is contained in:
tao wang 2022-09-03 18:19:45 +08:00 committed by Lane.Wei
parent f5c7919424
commit fbb9dfc41a
2 changed files with 17 additions and 8 deletions

View File

@ -526,7 +526,7 @@ AmsMapingTipPopup::AmsMapingTipPopup(wxWindow *parent)
m_sizer_body->Add(0, 0, 0, wxEXPAND | wxLEFT, FromDIP(20));
m_panel_enable_ams = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(200, -1), wxTAB_TRAVERSAL);
m_panel_enable_ams = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(FromDIP(220), -1), wxTAB_TRAVERSAL);
m_panel_enable_ams->SetBackgroundColour(*wxWHITE);
wxBoxSizer *sizer_enable_ams = new wxBoxSizer(wxVERTICAL);
@ -536,8 +536,9 @@ AmsMapingTipPopup::AmsMapingTipPopup(wxWindow *parent)
sizer_enable_ams->Add(m_title_enable_ams, 0, 0, 0);
m_tip_enable_ams = new wxStaticText(m_panel_enable_ams, wxID_ANY, _L("Print with filaments in the AMS"), wxDefaultPosition, wxDefaultSize, 0);
m_tip_enable_ams->SetMinSize(wxSize(FromDIP(200), FromDIP(50)));
m_tip_enable_ams->Wrap(FromDIP(200));
m_tip_enable_ams->SetBackgroundColour(*wxWHITE);
m_tip_enable_ams->Wrap(-1);
sizer_enable_ams->Add(m_tip_enable_ams, 0, wxTOP, 8);
wxBoxSizer *sizer_enable_ams_img;
@ -558,7 +559,7 @@ AmsMapingTipPopup::AmsMapingTipPopup(wxWindow *parent)
m_sizer_body->Add(m_split_lines, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, FromDIP(10));
m_panel_disable_ams = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(200, -1), wxTAB_TRAVERSAL);
m_panel_disable_ams = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(FromDIP(220), -1), wxTAB_TRAVERSAL);
m_panel_disable_ams->SetBackgroundColour(*wxWHITE);
wxBoxSizer *sizer_disable_ams;
sizer_disable_ams = new wxBoxSizer(wxVERTICAL);
@ -569,8 +570,9 @@ AmsMapingTipPopup::AmsMapingTipPopup(wxWindow *parent)
sizer_disable_ams->Add(m_title_disable_ams, 0, 0, 0);
m_tip_disable_ams = new wxStaticText(m_panel_disable_ams, wxID_ANY, _L("Print with the filament mounted on the back of chassis"), wxDefaultPosition, wxDefaultSize, 0);
m_tip_disable_ams->SetMinSize(wxSize(FromDIP(200), FromDIP(50)));
m_tip_disable_ams->Wrap(FromDIP(200));
m_tip_disable_ams->SetBackgroundColour(*wxWHITE);
m_tip_disable_ams->Wrap(-1);
sizer_disable_ams->Add(m_tip_disable_ams, 0, wxTOP, FromDIP(8));
wxBoxSizer *sizer_disable_ams_img;

View File

@ -931,7 +931,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
m_statictext_printer_msg->SetFont(::Label::Body_13);
m_statictext_printer_msg->Hide();
m_sizer_select = new wxGridSizer(1, 2, 0, 0);
m_sizer_select = new wxGridSizer(0, 2, 0, 0);
select_bed = create_item_checkbox(_L("Bed Leveling"), this, _L("Bed Leveling"), "bed_leveling");
select_flow = create_item_checkbox(_L("Flow Calibration"), this, _L("Flow Calibration"), "flow_cali");
select_use_ams = create_ams_checkbox(_L("Enable AMS"), this, _L("Enable AMS"));
@ -1081,13 +1081,20 @@ wxWindow *SelectMachineDialog::create_ams_checkbox(wxString title, wxWindow *par
img_ams_tip->Bind(wxEVT_ENTER_WINDOW, [this, img_ams_tip](auto &e) {
wxPoint pos = img_ams_tip->ClientToScreen(wxPoint(0, 0));
pos.y += img_ams_tip->GetRect().height;
m_mapping_tip_popup.Position(pos, wxSize(0, 0));
m_mapping_tip_popup.Position(pos, wxSize(0,0));
m_mapping_tip_popup.Popup();
});
img_ams_tip->Bind(wxEVT_LEAVE_WINDOW, [this, img_ams_tip](wxMouseEvent &e) {
auto region = m_mapping_tip_popup.GetClientRect();
img_ams_tip->Bind(wxEVT_LEAVE_WINDOW, [this, img_ams_tip](auto &e) {
m_mapping_tip_popup.Dismiss();
if(e.GetPosition().x > region.GetLeftTop().x && e.GetPosition().y > region.GetLeftTop().y && e.GetPosition().x < region.GetRightBottom().x && e.GetPosition().x < region.GetRightBottom().y)
;
else
m_mapping_tip_popup.Dismiss();
});
m_mapping_tip_popup.Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {
m_mapping_tip_popup.Dismiss();
});
checkbox->SetSizer(sizer_checkbox);
checkbox->Layout();