FIX:Display the interface then create big_bed_image_popup

jira: none
Change-Id: I020b72b71283a6873dcc2b4cd6fcf9ae98c6d0a4
This commit is contained in:
zhou.xu 2025-02-13 14:42:02 +08:00 committed by lane.wei
parent c414e51999
commit 4d934184e3
1 changed files with 10 additions and 2 deletions

View File

@ -1560,7 +1560,6 @@ Sidebar::Sidebar(Plater *parent)
wiki_bed->Bind(wxEVT_BUTTON, [](wxCommandEvent) {
wxLaunchDefaultBrowser("https://wiki.bambulab.com/en/x1/manual/compatibility-and-parameter-settings-of-filaments");
});
p->big_bed_image_popup = new ImageDPIFrame();
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, wxDefaultSize, 0);
@ -1577,7 +1576,10 @@ Sidebar::Sidebar(Plater *parent)
auto select_bed_type = get_cur_select_bed_type();
bool isDual = static_cast<wxBoxSizer *>(p->panel_printer_preset->GetSizer())->GetOrientation() == wxVERTICAL;
p->image_printer_bed->SetBitmap(create_scaled_bitmap(bed_type_thumbnails[select_bed_type], this, isDual ? 48 : 32));
p->big_bed_image_popup->set_bitmap(create_scaled_bitmap("big_" + bed_type_thumbnails[select_bed_type], p->big_bed_image_popup, p->big_bed_image_popup->get_image_px()));
if (p->big_bed_image_popup) {
p->big_bed_image_popup->set_bitmap(
create_scaled_bitmap("big_" + bed_type_thumbnails[select_bed_type], p->big_bed_image_popup, p->big_bed_image_popup->get_image_px()));
}
e.Skip(); // fix bug:Event spreads to sidebar
});
@ -1585,6 +1587,12 @@ Sidebar::Sidebar(Plater *parent)
auto pos = p->image_printer_bed->GetScreenPosition();
auto rect = p->image_printer_bed->GetRect();
wxPoint temp_pos(pos.x + rect.GetWidth(), pos.y);
if (p->big_bed_image_popup == nullptr) {
p->big_bed_image_popup = new ImageDPIFrame();
auto select_bed_type = get_cur_select_bed_type();
p->big_bed_image_popup->set_bitmap(
create_scaled_bitmap("big_" + bed_type_thumbnails[select_bed_type], p->big_bed_image_popup, p->big_bed_image_popup->get_image_px()));
}
p->big_bed_image_popup->SetCanFocus(false);
p->big_bed_image_popup->SetPosition(temp_pos);
p->big_bed_image_popup->on_show();