mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
update
This commit is contained in:
@@ -245,12 +245,12 @@ void Plater::show_illegal_characters_warning(wxWindow* parent)
|
||||
}
|
||||
|
||||
static std::map<BedType, std::string> bed_type_thumbnails = {
|
||||
{BedType::btPC, "bed_plate_cool_smooth" }, //"bed_cool"},
|
||||
{BedType::btEP, "bed_plate_engineering" }, //"bed_engineering"},
|
||||
{BedType::btPEI, "bed_plate_high_temp_smooth"}, //"bed_high_templ"},
|
||||
{BedType::btPTE, "bed_plate_pei" }, //"bed_pei"},
|
||||
{BedType::btPCT, "bed_plate_cool_textured" }, //"bed_pei"}, // TODO: Orca hack
|
||||
{BedType::btSuperTack, "bed_plate_cool_supertack" } //"bed_cool_supertack"}
|
||||
{BedType::btPC, "bed_cool" },
|
||||
{BedType::btEP, "bed_engineering" },
|
||||
{BedType::btPEI, "bed_high_templ" },
|
||||
{BedType::btPTE, "bed_pei" },
|
||||
{BedType::btPCT, "bed_pei_cool" },
|
||||
{BedType::btSuperTack, "bed_cool_supertack" }
|
||||
};
|
||||
|
||||
// print_model_id
|
||||
@@ -1750,8 +1750,7 @@ Sidebar::Sidebar(Plater *parent)
|
||||
dlg.ShowModal();
|
||||
});
|
||||
*/
|
||||
{
|
||||
// ORCA use Show/Hide to gain text area instead using blank icon
|
||||
// ORCA use Show/Hide to gain text area instead using blank icon. also manages hover effect for border
|
||||
for (wxWindow *w : std::initializer_list<wxWindow *>{p->panel_printer_preset, p->btn_edit_printer, p->image_printer, p->combo_printer}) {
|
||||
w->Bind(wxEVT_ENTER_WINDOW, [this](wxMouseEvent &e) {
|
||||
if(!p->combo_printer->HasFocus())
|
||||
@@ -1764,7 +1763,7 @@ Sidebar::Sidebar(Plater *parent)
|
||||
});
|
||||
w->Bind(wxEVT_LEAVE_WINDOW, [this, panel_bd_col](wxMouseEvent &e) {
|
||||
wxWindow* next_w = wxFindWindowAtPoint(wxGetMousePosition());
|
||||
if (!next_w || (next_w != p->panel_printer_preset && next_w != p->btn_edit_printer && next_w != p->image_printer && next_w != p->combo_printer)){
|
||||
if (!next_w || !p->panel_printer_preset->IsDescendant(next_w)){
|
||||
if(!p->combo_printer->HasFocus())
|
||||
p->panel_printer_preset->SetBorderColor(panel_bd_col);
|
||||
p->btn_edit_printer->Hide();
|
||||
@@ -1773,7 +1772,6 @@ Sidebar::Sidebar(Plater *parent)
|
||||
e.Skip();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// ORCA unified Nozzle diameter selection
|
||||
p->panel_nozzle_dia = new StaticBox(p->m_panel_printer_content);
|
||||
@@ -1828,6 +1826,22 @@ Sidebar::Sidebar(Plater *parent)
|
||||
p->combo_nozzle_dia->wxEvtHandler::ProcessEvent(evt);
|
||||
});
|
||||
|
||||
// highlight border on hover
|
||||
for (wxWindow *w : std::initializer_list<wxWindow *>{p->panel_nozzle_dia, p->label_nozzle_title, p->label_nozzle_type, p->combo_nozzle_dia}) {
|
||||
w->Bind(wxEVT_ENTER_WINDOW, [this](wxMouseEvent &e) {
|
||||
if(!p->combo_nozzle_dia->HasFocus())
|
||||
p->panel_nozzle_dia->SetBorderColor(wxColour("#009688"));
|
||||
e.Skip();
|
||||
});
|
||||
|
||||
w->Bind(wxEVT_LEAVE_WINDOW, [this, panel_bd_col](wxMouseEvent &e) {
|
||||
wxWindow* next_w = wxFindWindowAtPoint(wxGetMousePosition());
|
||||
if (!p->combo_nozzle_dia->HasFocus() && (!next_w || !p->panel_nozzle_dia->IsDescendant(next_w)))
|
||||
p->panel_nozzle_dia->SetBorderColor(panel_bd_col);
|
||||
e.Skip();
|
||||
});
|
||||
}
|
||||
|
||||
wxGridSizer *nozzle_dia_sizer = new wxGridSizer(3, 1, FromDIP(2), 0);
|
||||
nozzle_dia_sizer->Add(p->label_nozzle_title, 0, wxALIGN_CENTER | wxTOP, FromDIP(4));
|
||||
nozzle_dia_sizer->Add(p->combo_nozzle_dia , 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, FromDIP(2));
|
||||
@@ -1876,6 +1890,7 @@ Sidebar::Sidebar(Plater *parent)
|
||||
}
|
||||
e.Skip(); // fix bug:Event spreads to sidebar
|
||||
});
|
||||
|
||||
p->combo_printer_bed->Bind(wxEVT_LEAVE_WINDOW, [this](wxMouseEvent &evt) {
|
||||
if (p->big_bed_image_popup) {
|
||||
p->big_bed_image_popup->on_hide();
|
||||
@@ -1898,6 +1913,21 @@ Sidebar::Sidebar(Plater *parent)
|
||||
p->combo_printer_bed->Bind(wxEVT_SET_FOCUS, [this, bed_focus_bg](auto& e) {bed_focus_bg(true ); e.Skip();});
|
||||
p->combo_printer_bed->Bind(wxEVT_KILL_FOCUS, [this, bed_focus_bg](auto& e) {bed_focus_bg(false); e.Skip();});
|
||||
|
||||
// highlight border on hover
|
||||
for (wxWindow *w : std::initializer_list<wxWindow *>{p->panel_printer_bed, p->image_printer_bed, p->combo_printer_bed}) {
|
||||
w->Bind(wxEVT_ENTER_WINDOW, [this](wxMouseEvent &e) {
|
||||
if(!p->combo_printer_bed->HasFocus())
|
||||
p->panel_printer_bed->SetBorderColor(wxColour("#009688"));
|
||||
e.Skip();
|
||||
});
|
||||
w->Bind(wxEVT_LEAVE_WINDOW, [this, panel_bd_col](wxMouseEvent &e) {
|
||||
wxWindow* next_w = wxFindWindowAtPoint(wxGetMousePosition());
|
||||
if (!p->combo_printer_bed->HasFocus() && (!next_w || !p->panel_printer_bed->IsDescendant(next_w)))
|
||||
p->panel_printer_bed->SetBorderColor(panel_bd_col);
|
||||
e.Skip();
|
||||
});
|
||||
}
|
||||
|
||||
wxBoxSizer *bed_type_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
bed_type_sizer->Add(p->combo_printer_bed, 0, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(2));
|
||||
bed_type_sizer->Add(p->image_printer_bed, 0, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(2));
|
||||
|
||||
@@ -5026,40 +5026,42 @@ void PrinterInfoBox::UpdatePlate(const std::string& plate_name)
|
||||
{
|
||||
if (plate_name.empty())
|
||||
{
|
||||
m_text_bed_type->Hide();
|
||||
//m_text_bed_type->Hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
wxString name;
|
||||
if (plate_name == "Cool Plate") {
|
||||
name = _L("Cool");
|
||||
m_bed_image->SetBitmap(create_scaled_bitmap("bed_cool", this, 32));
|
||||
name = _L("Smooth Cool Plate");
|
||||
m_bed_image->SetBitmap(create_scaled_bitmap("bed_cool", this, 40));
|
||||
}
|
||||
else if (plate_name == "Engineering Plate") {
|
||||
name = _L("Engineering");
|
||||
m_bed_image->SetBitmap(create_scaled_bitmap("bed_engineering", this, 32));
|
||||
name = _L("Engineering Plate");
|
||||
m_bed_image->SetBitmap(create_scaled_bitmap("bed_engineering", this, 40));
|
||||
}
|
||||
else if (plate_name == "High Temp Plate") {
|
||||
name = _L("High Temp");
|
||||
m_bed_image->SetBitmap(create_scaled_bitmap("bed_high_templ", this, 32));
|
||||
name = _L("Smooth High Temp Plate");
|
||||
m_bed_image->SetBitmap(create_scaled_bitmap("bed_high_templ", this, 40));
|
||||
}
|
||||
else if (plate_name == "Textured PEI Plate") {
|
||||
name = "PEI";
|
||||
m_bed_image->SetBitmap(create_scaled_bitmap("bed_pei", this, 32));
|
||||
name = _L("Textured PEI Plate");
|
||||
m_bed_image->SetBitmap(create_scaled_bitmap("bed_pei", this, 40));
|
||||
}
|
||||
else if (plate_name == "Supertack Plate") {
|
||||
name = _L("Cool(Supertack)");
|
||||
m_bed_image->SetBitmap(create_scaled_bitmap("bed_cool_supertack", this, 32));
|
||||
name = _L("Cool Plate (Supertack)");
|
||||
m_bed_image->SetBitmap(create_scaled_bitmap("bed_cool_supertack", this, 40));
|
||||
}
|
||||
|
||||
if (name.length() > 8) {
|
||||
m_text_bed_type->SetFont(Label::Body_9);
|
||||
}
|
||||
else{
|
||||
m_text_bed_type->SetFont(Label::Body_12);
|
||||
}
|
||||
m_text_bed_type->SetLabelText(name);
|
||||
m_text_bed_type->Show();
|
||||
m_bed_image->SetToolTip(name);
|
||||
|
||||
//if (name.length() > 8) {
|
||||
// m_text_bed_type->SetFont(Label::Body_9);
|
||||
//}
|
||||
//else{
|
||||
// m_text_bed_type->SetFont(Label::Body_12);
|
||||
//}
|
||||
//m_text_bed_type->SetLabelText(name);
|
||||
//m_text_bed_type->Show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5209,24 +5211,26 @@ void PrinterInfoBox::Create()
|
||||
|
||||
/*bed area*/
|
||||
auto bed_staticbox = new StaticBox(this);
|
||||
bed_staticbox->SetMinSize(wxSize(FromDIP(98), FromDIP(68)));
|
||||
bed_staticbox->SetMaxSize(wxSize(FromDIP(98), FromDIP(68)));
|
||||
bed_staticbox->SetMinSize(wxSize(FromDIP(68), FromDIP(68)));
|
||||
bed_staticbox->SetMaxSize(wxSize(FromDIP(68), FromDIP(68)));
|
||||
bed_staticbox->SetBorderColor(wxColour("#EEEEEE"));
|
||||
|
||||
m_bed_image = new wxStaticBitmap(bed_staticbox, wxID_ANY, create_scaled_bitmap("bed_cool", this, 32));
|
||||
m_bed_image = new wxStaticBitmap(bed_staticbox, wxID_ANY, create_scaled_bitmap("bed_cool", this, 40));
|
||||
m_bed_image->SetBackgroundColour(*wxWHITE);
|
||||
m_bed_image->SetMinSize(wxSize(FromDIP(32), FromDIP(32)));
|
||||
m_bed_image->SetMaxSize(wxSize(FromDIP(32), FromDIP(32)));
|
||||
m_bed_image->SetMinSize(wxSize(FromDIP(40), FromDIP(40)));
|
||||
m_bed_image->SetMaxSize(wxSize(FromDIP(40), FromDIP(40)));
|
||||
|
||||
m_text_bed_type = new Label(bed_staticbox);
|
||||
m_text_bed_type->SetForegroundColour(wxColour(144, 144, 144));
|
||||
m_text_bed_type->SetMaxSize(wxSize(FromDIP(80), FromDIP(24)));
|
||||
m_text_bed_type->SetFont(Label::Body_13);
|
||||
//m_text_bed_type = new Label(bed_staticbox);
|
||||
//m_text_bed_type->SetForegroundColour(wxColour(144, 144, 144));
|
||||
//m_text_bed_type->SetMaxSize(wxSize(FromDIP(80), FromDIP(24)));
|
||||
//m_text_bed_type->SetFont(Label::Body_13);
|
||||
|
||||
sizer_bed_staticbox->Add(0, 0, 0, wxTOP, FromDIP(10));
|
||||
//sizer_bed_staticbox->Add(0, 0, 0, wxTOP, FromDIP(10));
|
||||
sizer_bed_staticbox->AddStretchSpacer();
|
||||
sizer_bed_staticbox->Add(m_bed_image, 0, wxALIGN_CENTER, 0);
|
||||
sizer_bed_staticbox->AddSpacer(FromDIP(6));
|
||||
sizer_bed_staticbox->Add(m_text_bed_type, 0, wxALIGN_CENTER, 0);
|
||||
sizer_bed_staticbox->AddStretchSpacer();
|
||||
//sizer_bed_staticbox->AddSpacer(FromDIP(6));
|
||||
//sizer_bed_staticbox->Add(m_text_bed_type, 0, wxALIGN_CENTER, 0);
|
||||
|
||||
bed_staticbox->SetSizer(sizer_bed_staticbox);
|
||||
bed_staticbox->Layout();
|
||||
@@ -5238,7 +5242,7 @@ void PrinterInfoBox::Create()
|
||||
|
||||
|
||||
wxSizer* main_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
main_sizer->Add(m_text_bed_type, 0, wxTOP, 0);
|
||||
//main_sizer->Add(m_text_bed_type, 0, wxTOP, 0);
|
||||
main_sizer->Add(0, 0, 0, wxTOP, FromDIP(15));
|
||||
main_sizer->Add(sizer_split_printer, 1, wxEXPAND, 0);
|
||||
main_sizer->Add(0, 0, 0, wxTOP, FromDIP(8));
|
||||
|
||||
Reference in New Issue
Block a user