FIX: something with gui

Change-Id: Ia9007ea0f446f6d83031cc2c4091db06bb5762d7
Jira: STUDIO-9482, STUDIO-9579, STUDIO-9545
(cherry picked from commit 53e9661372cf63b87d2f9605d4131eec0ecaa82c)
This commit is contained in:
chunmao.guo
2025-01-08 13:18:23 +08:00
committed by Noisyfox
parent a8d10da9dd
commit ab986945be
2 changed files with 19 additions and 11 deletions

View File

@@ -365,7 +365,8 @@ struct ExtruderGroup : StaticGroup
{
ams_n4 = n4;
ams_n1 = n1;
update_ams();
if (btn_edit)
update_ams();
}
void update_ams();
@@ -914,7 +915,7 @@ ExtruderGroup::ExtruderGroup(wxWindow * parent, int index, wxString const &title
ShowBadge(true);
// Nozzle
wxStaticText *label_nozzle = new wxStaticText(this, wxID_ANY, _L("Nozzle"));
wxStaticText *label_nozzle = new wxStaticText(this, wxID_ANY, _L("Flow"));
label_nozzle->SetFont(Label::Body_14);
label_nozzle->SetForegroundColour("#262E30");
auto combo_nozzle = new ComboBox(this, wxID_ANY, wxString(""), wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY);
@@ -966,7 +967,7 @@ ExtruderGroup::ExtruderGroup(wxWindow * parent, int index, wxString const &title
hsizer_ams->SetMinSize(0, ams[0]->GetMinHeight());
hsizer_ams->Add(label_ams, 0, wxALIGN_CENTER);
if (btn_edit)
hsizer_ams->Add(btn_edit, 0, 0);
hsizer_ams->Add(btn_edit, 0, wxLEFT | wxALIGN_CENTER, FromDIP(2));
up_down_btn = new ScalableButton(this, wxID_ANY, "dot");
up_down_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this, index](auto &evt) {
@@ -978,9 +979,10 @@ ExtruderGroup::ExtruderGroup(wxWindow * parent, int index, wxString const &title
hsizer_nozzle->Add(label_nozzle, 2, wxALIGN_CENTER);
hsizer_nozzle->Add(combo_nozzle, 3, wxEXPAND);
if (index < 0) {
label_ams->Hide();
ams_not_installed_msg->Hide();
wxStaticBoxSizer *hsizer = new wxStaticBoxSizer(this, wxHORIZONTAL);
hsizer->Add(hsizer_ams, 1, wxLEFT | wxTOP | wxBOTTOM | wxALIGN_CENTER, FromDIP(4));
hsizer->Add(hsizer_nozzle, 1, wxALL | wxALIGN_CENTER, FromDIP(4));
hsizer->Add(hsizer_nozzle, 1, wxEXPAND | wxALL, FromDIP(2));
hsizer->AddSpacer(FromDIP(4));
this->sizer = hsizer;
} else {
@@ -1437,7 +1439,7 @@ Sidebar::Sidebar(Plater *parent)
});
ScalableBitmap bitmap_bed(p->panel_printer_bed, "printer_placeholder", 32);
p->image_printer_bed = new wxStaticBitmap(p->panel_printer_bed, wxID_ANY, bitmap_bed.bmp(), wxDefaultPosition, PRINTER_THUMBNAIL_SIZE_SMALL, 0);
p->image_printer_bed = new wxStaticBitmap(p->panel_printer_bed, wxID_ANY, bitmap_bed.bmp(), wxDefaultPosition, wxDefaultSize, 0);
p->combo_printer_bed = new ComboBox(p->panel_printer_bed, wxID_ANY, wxString(""), wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY | wxALIGN_CENTER_HORIZONTAL);
p->combo_printer_bed->SetBorderWidth(0);
@@ -1451,7 +1453,8 @@ Sidebar::Sidebar(Plater *parent)
p->combo_printer_bed->Bind(wxEVT_COMBOBOX, [this](auto &e) {
int selection = p->combo_printer_bed->GetSelection();
p->image_printer_bed->SetBitmap(create_scaled_bitmap(bed_type_thumbnails[BedType(selection + 1)], this, 32));
bool isDual = static_cast<wxBoxSizer *>(p->panel_printer_preset->GetSizer())->GetOrientation() == wxVERTICAL;
p->image_printer_bed->SetBitmap(create_scaled_bitmap(bed_type_thumbnails[BedType(selection + 1)], this, isDual ? 48 : 32));
e.Skip();//fix bug:Event spreads to sidebar
});
@@ -1527,9 +1530,9 @@ Sidebar::Sidebar(Plater *parent)
});
p->btn_sync_printer = btn_sync;
p->left_extruder = new ExtruderGroup(p->m_panel_printer_content, 0, _L("Left"));
p->right_extruder = new ExtruderGroup(p->m_panel_printer_content, 1, _L("Right"));
p->single_extruder = new ExtruderGroup(p->m_panel_printer_content, -1, "");
p->left_extruder = new ExtruderGroup(p->m_panel_printer_content, 0, _L("Left Nozzle"));
p->right_extruder = new ExtruderGroup(p->m_panel_printer_content, 1, _L("Right Nozzle"));
p->single_extruder = new ExtruderGroup(p->m_panel_printer_content, -1, "Nozzle");
p->vsizer_printer = new wxBoxSizer(wxVERTICAL);
p->layout_printer(true, true);
@@ -2150,7 +2153,8 @@ void Sidebar::msw_rescale()
p->m_printer_icon->msw_rescale();
p->m_printer_setting->msw_rescale();
p->image_printer->SetSize(PRINTER_THUMBNAIL_SIZE);
p->image_printer_bed->SetSize(PRINTER_THUMBNAIL_SIZE_SMALL);
bool isDual = static_cast<wxBoxSizer *>(p->panel_printer_preset->GetSizer())->GetOrientation() == wxVERTICAL;
p->image_printer_bed->SetBitmap(create_scaled_bitmap(bed_type_thumbnails[BedType(p->combo_printer_bed->GetSelection() + 1)], this, 48));
p->m_filament_icon->msw_rescale();
p->m_bpButton_add_filament->msw_rescale();
p->m_bpButton_del_filament->msw_rescale();