Compact Printer Selection UI - part 2 (#11401)
* update
* match bbl covers with profile folder
* Update printer_placeholder.png
* match vertical margins
* improve logic for showing bed type preview
* fix focus
* fix conflict
* fix conflict
* Update printer_placeholder.png
* Update Plater.cpp
* Update printer_placeholder.png
* revert changes for margins
* Update Plater.cpp
* Update Plater.cpp
* Revert "Update Plater.cpp"
This reverts commit f73e482081.
* Update Plater.cpp
* fix badges not visible
* fix badge
* Update Plater.cpp
* update sync icon
* improve cover auto hide logic
* Update Plater.cpp
* delete bed type images
* simplify events
* hide nozzle selector for ToolChangers
* fix bed type not remembers value after printer change
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 121 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 130 KiB |
|
Before Width: | Height: | Size: 121 KiB |
|
Before Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 246 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 227 KiB |
|
Before Width: | Height: | Size: 246 KiB |
|
Before Width: | Height: | Size: 172 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 967 B |
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 24 KiB |
|
|
@ -1,10 +1 @@
|
|||
<svg width="33" height="33" viewBox="0 0 33 33" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_20864_22082)">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.2625 6.52839C13.3644 6.52839 10.7571 7.76588 8.93706 9.74469C8.8807 9.80598 8.82509 9.86797 8.77026 9.93066L7.0642 8.43829C7.13145 8.36142 7.19964 8.2854 7.26876 8.21025C9.49998 5.78438 12.7042 4.26172 16.2625 4.26172C21.9679 4.26172 26.7599 8.17288 28.1035 13.4603L29.7967 11.0823L31.6432 12.397L26.2125 20.0242V16.4784C26.2125 10.9832 21.7577 6.52839 16.2625 6.52839ZM5.89404 12.9327V16.4784C5.89404 21.9737 10.3488 26.4285 15.8441 26.4285C18.7421 26.4285 21.3494 25.191 23.1695 23.2122C23.2259 23.1509 23.2815 23.0889 23.3363 23.0262L25.0424 24.5186C24.9751 24.5955 24.9069 24.6715 24.8378 24.7466C22.6066 27.1725 19.4023 28.6952 15.8441 28.6952C10.1386 28.6952 5.34663 24.784 4.00303 19.4966L2.30982 21.8746L0.463379 20.5599L5.89404 12.9327Z" fill="#009688"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_20864_22082">
|
||||
<rect width="32" height="32" fill="white" transform="translate(0.0532227 0.476562)"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><polyline points="2 12 2 6 4 7" style="fill:#009688; stroke:#009688; stroke-linecap:round; stroke-linejoin:round; stroke-width:2px;"/><polyline points="28 25 30 26 30 26 30 20" style="fill:#009688; stroke:#009688; stroke-linecap:round; stroke-linejoin:round; stroke-width:2px;"/><path d="M29.41,12c-1.72-5.78-7.07-10-13.41-10S4.31,6.22,2.59,12" style="fill:none; stroke:#009688; stroke-linecap:round; stroke-linejoin:round; stroke-width:2px;"/><path d="M2.59,20c1.72,5.78,7.07,10,13.41,10s11.69-4.22,13.41-10" style="fill:none; stroke:#009688; stroke-linecap:round; stroke-linejoin:round; stroke-width:2px;"/></svg>
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 743 B |
|
|
@ -1 +1 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><circle cx="7.5" cy="7.5" r="4" style="fill:none; stroke:#949494; stroke-linecap:round; stroke-linejoin:round;"/><line x1=".5" y1=".5" x2=".5" y2="4.5" style="fill:none; stroke:#949494; stroke-linecap:round; stroke-linejoin:round;"/><line x1="14.5" y1="14.5" x2="14.5" y2="10.5" style="fill:none; stroke:#949494; stroke-linecap:round; stroke-linejoin:round;"/><path d="M13.83,4.5C12.71,2.13,10.3.5,7.5.5c-2.71,0-5.17,1.56-6.33,4" style="fill:none; stroke:#949494; stroke-linecap:round; stroke-linejoin:round;"/><path d="M1.27,10.69c1.16,2.26,3.51,3.81,6.23,3.81,2.71,0,5.17-1.56,6.33-4" style="fill:none; stroke:#949494; stroke-linecap:round; stroke-linejoin:round;"/></svg>
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><polyline points=".5 5.5 .5 2.5 1.5 3" style="fill:#949494; stroke:#949494; stroke-linecap:round; stroke-linejoin:round;"/><polyline points="13.5 12 14.5 12.5 14.5 12.5 14.5 9.5" style="fill:#949494; stroke:#949494; stroke-linecap:round; stroke-linejoin:round;"/><path d="M14.21,5.5c-.86-2.89-3.54-5-6.71-5S1.65,2.61.79,5.5" style="fill:none; stroke:#949494; stroke-linecap:round; stroke-linejoin:round;"/><path d="M.79,9.5c.86,2.89,3.54,5,6.71,5s5.85-2.11,6.71-5" style="fill:none; stroke:#949494; stroke-linecap:round; stroke-linejoin:round;"/></svg>
|
||||
|
Before Width: | Height: | Size: 802 B After Width: | Height: | Size: 680 B |
|
|
@ -1 +1 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><circle cx="7.5" cy="7.5" r="4" style="fill:#009688; stroke:#009688; stroke-linecap:round; stroke-linejoin:round;"/><line x1=".5" y1=".5" x2=".5" y2="4.5" style="fill:none; stroke:#949494; stroke-linecap:round; stroke-linejoin:round;"/><line x1="14.5" y1="14.5" x2="14.5" y2="10.5" style="fill:none; stroke:#949494; stroke-linecap:round; stroke-linejoin:round;"/><path d="M13.83,4.5C12.71,2.13,10.3.5,7.5.5c-2.71,0-5.17,1.56-6.33,4" style="fill:none; stroke:#949494; stroke-linecap:round; stroke-linejoin:round;"/><path d="M1.27,10.69c1.16,2.26,3.51,3.81,6.23,3.81,2.71,0,5.17-1.56,6.33-4" style="fill:none; stroke:#949494; stroke-linecap:round; stroke-linejoin:round;"/></svg>
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><polyline points=".5 5.5 .5 2.5 1.5 3" style="fill:#009688; stroke:#009688; stroke-linecap:round; stroke-linejoin:round;"/><polyline points="13.5 12 14.5 12.5 14.5 12.5 14.5 9.5" style="fill:#009688; stroke:#009688; stroke-linecap:round; stroke-linejoin:round;"/><polyline points="4.5 7.5 6.5 9.5 10.5 5.5" style="fill:none; stroke:#009688; stroke-linecap:round; stroke-linejoin:round;"/><path d="M14.21,5.5c-.86-2.89-3.54-5-6.71-5S1.65,2.61.79,5.5" style="fill:none; stroke:#009688; stroke-linecap:round; stroke-linejoin:round;"/><path d="M.79,9.5c.86,2.89,3.54,5,6.71,5s5.85-2.11,6.71-5" style="fill:none; stroke:#009688; stroke-linecap:round; stroke-linejoin:round;"/></svg>
|
||||
|
Before Width: | Height: | Size: 805 B After Width: | Height: | Size: 805 B |
|
|
@ -146,7 +146,6 @@ void ImageDPIFrame::on_hide()
|
|||
wxGetApp().mainframe->Raise();
|
||||
}
|
||||
}
|
||||
set_title(""); // reset title on hide
|
||||
}
|
||||
|
||||
} // namespace GUI
|
||||
|
|
|
|||
|
|
@ -214,6 +214,7 @@ wxDEFINE_EVENT(EVT_NOTICE_CHILDE_SIZE_CHANGED, SimpleEvent);
|
|||
wxDEFINE_EVENT(EVT_NOTICE_FULL_SCREEN_CHANGED, IntEvent);
|
||||
#define PRINTER_THUMBNAIL_SIZE (wxSize(40, 40)) // ORCA
|
||||
#define PRINTER_PANEL_SIZE ( wxSize(70, 60)) // ORCA
|
||||
#define PRINTER_PANEL_RADIUS (6) // ORCA
|
||||
#define BTN_SYNC_SIZE (wxSize(FromDIP(96), FromDIP(98)))
|
||||
|
||||
static string get_diameter_string(float diameter)
|
||||
|
|
@ -245,12 +246,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" }
|
||||
};
|
||||
|
||||
enum SlicedInfoIdx
|
||||
|
|
@ -544,7 +545,7 @@ void Sidebar::priv::layout_printer(bool isBBL, bool isDual)
|
|||
//hsizer_printer->Add(btn_sync_printer , 0, wxLEFT, FromDIP(4));
|
||||
vsizer_printer->AddSpacer(FromDIP(SidebarProps::ContentMarginV()));
|
||||
vsizer_printer->Add(hsizer_printer, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(SidebarProps::ContentMargin()));
|
||||
vsizer_printer->AddSpacer(FromDIP(SidebarProps::ContentMarginV()));
|
||||
|
||||
// Printer - extruder
|
||||
|
||||
// double
|
||||
|
|
@ -559,7 +560,9 @@ void Sidebar::priv::layout_printer(bool isBBL, bool isDual)
|
|||
extruder_sizer->Add(extruder_dual_sizer , 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(SidebarProps::ContentMargin()));
|
||||
extruder_sizer->Add(extruder_single_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(SidebarProps::ContentMargin()));
|
||||
|
||||
vsizer_printer->Add(extruder_sizer, 1, wxEXPAND | wxBOTTOM, FromDIP(8));
|
||||
vsizer_printer->Add(extruder_sizer, 1, wxEXPAND | wxTOP, FromDIP(2));
|
||||
|
||||
vsizer_printer->AddSpacer(FromDIP(SidebarProps::ContentMarginV()));
|
||||
}
|
||||
|
||||
//btn_connect_printer->Show(!isBBL);
|
||||
|
|
@ -576,7 +579,7 @@ void Sidebar::priv::layout_printer(bool isBBL, bool isDual)
|
|||
|
||||
// NEEDFIX requires AMS check or any type of ???
|
||||
// Single nozzle & non ams
|
||||
panel_nozzle_dia->Show(!isDual);
|
||||
panel_nozzle_dia->Show(!isDual && preset_bundle.get_printer_extruder_count() < 2);
|
||||
extruder_single_sizer->Show(false);
|
||||
}
|
||||
|
||||
|
|
@ -992,6 +995,7 @@ ExtruderGroup::ExtruderGroup(wxWindow * parent, int index, wxString const &title
|
|||
SetFont(Label::Body_10);
|
||||
SetForegroundColour(wxColour("#CECECE"));
|
||||
SetBorderColor(wxColour("#EEEEEE"));
|
||||
SetCornerRadius(FromDIP(PRINTER_PANEL_RADIUS)); // ORCA match radius with other boxes
|
||||
ShowBadge(true);
|
||||
// Nozzle
|
||||
wxStaticText *label_diameter = new wxStaticText(this, wxID_ANY, _L("Diameter"));
|
||||
|
|
@ -1096,8 +1100,8 @@ ExtruderGroup::ExtruderGroup(wxWindow * parent, int index, wxString const &title
|
|||
this->sizer = hsizer;
|
||||
} else {
|
||||
wxStaticBoxSizer *vsizer = new wxStaticBoxSizer(this, wxVERTICAL);
|
||||
vsizer->Add(hsizer_ams, 0, wxEXPAND | wxLEFT | wxTOP | wxRIGHT, FromDIP(2));
|
||||
vsizer->Add(hsizer_diameter, 0, wxEXPAND | wxLEFT | wxTOP | wxRIGHT, FromDIP(2));
|
||||
vsizer->Add(hsizer_ams, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(2));
|
||||
vsizer->Add(hsizer_diameter, 0, wxEXPAND | wxLEFT | wxTOP | wxRIGHT | wxBOTTOM, FromDIP(2));
|
||||
//vsizer->Add(hsizer_nozzle, 0, wxEXPAND | wxALL, FromDIP(2));
|
||||
this->sizer = vsizer;
|
||||
}
|
||||
|
|
@ -1359,6 +1363,7 @@ void Sidebar::priv::update_sync_status(const MachineObject *obj)
|
|||
auto clear_all_sync_status = [this, ¬_synced_colour]() {
|
||||
panel_printer_preset->ShowBadge(false);
|
||||
panel_printer_bed->ShowBadge(false);
|
||||
panel_nozzle_dia->ShowBadge(false); // ORCA add support for nozzle sync
|
||||
left_extruder->ShowBadge(false);
|
||||
left_extruder->sync_ams(nullptr, {}, {});
|
||||
right_extruder->ShowBadge(false);
|
||||
|
|
@ -1486,11 +1491,13 @@ void Sidebar::priv::update_sync_status(const MachineObject *obj)
|
|||
if (extruder_nums == 1) {
|
||||
if (is_same_nozzle_info(extruder_infos[0], machine_extruder_infos[0])) {
|
||||
single_extruder->ShowBadge(true);
|
||||
panel_nozzle_dia->ShowBadge(true); // ORCA add support for nozzle sync
|
||||
single_extruder->sync_ams(obj, machine_extruder_infos[0].ams_v4, machine_extruder_infos[0].ams_v1);
|
||||
extruder_synced[0] = true;
|
||||
}
|
||||
else {
|
||||
single_extruder->ShowBadge(false);
|
||||
panel_nozzle_dia->ShowBadge(false); // ORCA add support for nozzle sync
|
||||
single_extruder->sync_ams(obj, {}, {});
|
||||
}
|
||||
}
|
||||
|
|
@ -1664,62 +1671,69 @@ Sidebar::Sidebar(Plater *parent)
|
|||
|
||||
p->m_panel_printer_content = new wxPanel(p->scrolled, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
|
||||
p->m_panel_printer_content->SetBackgroundColour(wxColour(255, 255, 255));
|
||||
StateColor panel_bd_col(std::pair<wxColour, int>(wxColour("#009688"), StateColor::Pressed),
|
||||
std::pair<wxColour, int>(wxColour("#009688"), StateColor::Hovered),
|
||||
std::pair<wxColour, int>(wxColour("#DBDBDB"), StateColor::Normal));
|
||||
|
||||
struct PanelColors {
|
||||
wxColour bg_normal = "#FFFFFF";
|
||||
wxColour bg_focus = "#E5F0EE";
|
||||
wxColour bd_normal = "#DBDBDB";
|
||||
wxColour bd_hover = "#009688";
|
||||
wxColour bd_focus = "#009688";
|
||||
};
|
||||
PanelColors panel_color;
|
||||
|
||||
p->panel_printer_preset = new StaticBox(p->m_panel_printer_content);
|
||||
p->panel_printer_preset->SetCornerRadius(FromDIP(8));
|
||||
p->panel_printer_preset->SetBorderColor(panel_bd_col);
|
||||
p->panel_printer_preset->SetCornerRadius(FromDIP(PRINTER_PANEL_RADIUS));
|
||||
p->panel_printer_preset->SetBorderColor(panel_color.bd_normal);
|
||||
p->panel_printer_preset->SetMinSize(FromDIP(PRINTER_PANEL_SIZE));
|
||||
p->panel_printer_preset->Bind(wxEVT_LEFT_DOWN, [this](auto & evt) {
|
||||
p->combo_printer->wxEvtHandler::ProcessEvent(evt);
|
||||
});
|
||||
// ORCA Hide Cover automatically if there is not enough space
|
||||
p->panel_printer_preset->Bind(wxEVT_SIZE, [this](auto & e) {
|
||||
bool is_narrow = e.GetSize().GetWidth() < p->scrolled->FromDIP(235);
|
||||
if(is_narrow && p->image_printer->IsShown())
|
||||
auto current_width = e.GetSize().GetWidth();
|
||||
auto narrow_width = FromDIP(235);
|
||||
auto label_width = p->combo_printer->GetTextExtent(p->combo_printer->GetStringSelection()).GetWidth();
|
||||
auto min_width = label_width + FromDIP(25 + PRINTER_PANEL_SIZE.GetWidth());
|
||||
if(((min_width < narrow_width && min_width > current_width) || (current_width < narrow_width && min_width > narrow_width)) && p->image_printer->IsShown())
|
||||
p->image_printer->Hide();
|
||||
else if(!is_narrow && !p->image_printer->IsShown())
|
||||
else if((current_width > min_width || !(current_width < narrow_width)) && !p->image_printer->IsShown())
|
||||
p->image_printer->Show();
|
||||
e.Skip();
|
||||
});
|
||||
|
||||
ScalableButton *edit_btn = new ScalableButton(p->panel_printer_preset, wxID_ANY, "edit");
|
||||
edit_btn->SetToolTip(_L("Click to edit preset"));
|
||||
edit_btn->Hide(); // hide for first launch
|
||||
edit_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent)
|
||||
{
|
||||
p->editing_filament = -1;
|
||||
if (p->combo_printer->switch_to_tab())
|
||||
p->editing_filament = 0;
|
||||
});
|
||||
p->btn_edit_printer = edit_btn;
|
||||
p->btn_edit_printer = new ScalableButton(p->panel_printer_preset, wxID_ANY, "edit");
|
||||
p->btn_edit_printer->SetToolTip(_L("Click to edit preset"));
|
||||
p->btn_edit_printer->Hide(); // hide for first launch
|
||||
p->btn_edit_printer->Bind(wxEVT_BUTTON, [this, panel_color](wxCommandEvent){
|
||||
p->editing_filament = -1;
|
||||
if (p->combo_printer->switch_to_tab())
|
||||
p->editing_filament = 0;
|
||||
// ORCA clicking edit button not triggers wxEVT_KILL_FOCUS wxEVT_LEAVE_WINDOW make changes manually to prevent stucked colors when opening printer settings
|
||||
p->panel_printer_preset->SetBorderColor(panel_color.bd_normal);
|
||||
p->btn_edit_printer->Hide();
|
||||
p->panel_printer_preset->Layout();
|
||||
});
|
||||
|
||||
ScalableBitmap bitmap_printer(p->panel_printer_preset, "printer_placeholder", PRINTER_THUMBNAIL_SIZE.GetHeight());
|
||||
p->image_printer = new wxStaticBitmap(p->panel_printer_preset, wxID_ANY, bitmap_printer.bmp(), wxDefaultPosition, FromDIP(PRINTER_THUMBNAIL_SIZE), 0);
|
||||
p->image_printer->Bind(wxEVT_LEFT_DOWN, [this](auto &evt) {
|
||||
p->combo_printer->wxEvtHandler::ProcessEvent(evt);
|
||||
});
|
||||
|
||||
PlaterPresetComboBox *combo_printer = new PlaterPresetComboBox(p->panel_printer_preset, Preset::TYPE_PRINTER);
|
||||
//combo_printer->SetWindowStyle(combo_printer->GetWindowStyle() & ~wxALIGN_MASK | wxALIGN_CENTER_HORIZONTAL);
|
||||
combo_printer->SetBorderWidth(0);
|
||||
p->combo_printer = combo_printer;
|
||||
p->combo_printer = new PlaterPresetComboBox(p->panel_printer_preset, Preset::TYPE_PRINTER);
|
||||
p->combo_printer->SetBorderWidth(0);
|
||||
p->combo_printer->SetMaxSize(wxSize(-1, FromDIP(30))); // limiting height makes badge visible
|
||||
// ORCA paint whole combobox on focus
|
||||
auto printer_focus_bg = [this, panel_bd_col](bool focused){
|
||||
auto bg_color = StateColor::darkModeColorFor(wxColour(focused ? "#E5F0EE" : "#FFFFFF"));
|
||||
auto panel = p->panel_printer_preset;
|
||||
panel->SetBackgroundColor(bg_color);
|
||||
if(focused)
|
||||
panel->SetBorderColor(wxColour("#009688"));
|
||||
else
|
||||
panel->SetBorderColor(panel_bd_col);
|
||||
auto printer_focus_bg = [this, panel_color](bool focused){
|
||||
auto bg_color = StateColor::darkModeColorFor(focused ? panel_color.bg_focus : panel_color.bg_normal);
|
||||
p->panel_printer_preset->SetBackgroundColor(bg_color);
|
||||
p->panel_printer_preset->SetBorderColor(focused ? panel_color.bd_focus : panel_color.bd_normal);
|
||||
p->btn_edit_printer->SetBackgroundColour(bg_color);
|
||||
p->image_printer->SetBackgroundColour(bg_color);
|
||||
p->combo_printer->SetBackgroundColour(bg_color); // paints margins instead combo background
|
||||
};
|
||||
combo_printer->Bind(wxEVT_SET_FOCUS, [this, printer_focus_bg](auto& e) {printer_focus_bg(true ); e.Skip();});
|
||||
combo_printer->Bind(wxEVT_KILL_FOCUS, [this, printer_focus_bg](auto& e) {printer_focus_bg(false); e.Skip();});
|
||||
p->combo_printer->Bind(wxEVT_SET_FOCUS, [this, printer_focus_bg](auto& e) {printer_focus_bg(true ); e.Skip();});
|
||||
p->combo_printer->Bind(wxEVT_KILL_FOCUS, [this, printer_focus_bg](auto& e) {printer_focus_bg(false); e.Skip();});
|
||||
|
||||
/* ORCA This part moved to titlebar
|
||||
p->btn_connect_printer = new ScalableButton(p->panel_printer_preset, wxID_ANY, "monitor_signal_strong");
|
||||
|
|
@ -1731,45 +1745,40 @@ 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) {
|
||||
w->Bind(wxEVT_ENTER_WINDOW, [this, panel_color](wxMouseEvent &e) {
|
||||
if(!p->combo_printer->HasFocus())
|
||||
p->panel_printer_preset->SetBorderColor(wxColour("#009688"));
|
||||
p->panel_printer_preset->SetBorderColor(panel_color.bd_hover);
|
||||
if(!p->btn_edit_printer->IsShown()){
|
||||
p->btn_edit_printer->Show();
|
||||
p->panel_printer_preset->Layout();
|
||||
}
|
||||
e.Skip();
|
||||
});
|
||||
w->Bind(wxEVT_LEAVE_WINDOW, [this, panel_bd_col](wxMouseEvent &e) {
|
||||
w->Bind(wxEVT_LEAVE_WINDOW, [this, panel_color](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->panel_printer_preset->SetBorderColor(panel_color.bd_normal);
|
||||
p->btn_edit_printer->Hide();
|
||||
p->panel_printer_preset->Layout();
|
||||
}
|
||||
e.Skip();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// ORCA unified Nozzle diameter selection
|
||||
p->panel_nozzle_dia = new StaticBox(p->m_panel_printer_content);
|
||||
p->panel_nozzle_dia->SetCornerRadius(FromDIP(8));
|
||||
p->panel_nozzle_dia->SetBorderColor(panel_bd_col);
|
||||
p->panel_nozzle_dia->SetCornerRadius(FromDIP(PRINTER_PANEL_RADIUS));
|
||||
p->panel_nozzle_dia->SetBorderColor(panel_color.bd_normal);
|
||||
p->panel_nozzle_dia->SetMinSize(FromDIP(PRINTER_PANEL_SIZE));
|
||||
p->panel_nozzle_dia->Bind(wxEVT_LEFT_DOWN, [this](auto & evt) {
|
||||
p->combo_nozzle_dia->wxEvtHandler::ProcessEvent(evt);
|
||||
});
|
||||
|
||||
p->label_nozzle_title = new Label(p->panel_nozzle_dia, _L("Nozzle"));
|
||||
p->label_nozzle_title = new Label(p->panel_nozzle_dia, _L("Nozzle"), LB_PROPAGATE_MOUSE_EVENT);
|
||||
p->label_nozzle_title->SetFont(Label::Body_10);
|
||||
p->label_nozzle_title->Bind(wxEVT_LEFT_DOWN, [this](auto & evt) {
|
||||
p->combo_nozzle_dia->wxEvtHandler::ProcessEvent(evt);
|
||||
});
|
||||
|
||||
p->combo_nozzle_dia = new ComboBox(p->panel_nozzle_dia, wxID_ANY, wxString(""), wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY);
|
||||
p->combo_nozzle_dia->SetBorderWidth(0);
|
||||
|
|
@ -1786,14 +1795,10 @@ Sidebar::Sidebar(Plater *parent)
|
|||
e.Skip();
|
||||
});
|
||||
// ORCA paint whole combobox on focus
|
||||
auto nozzle_focus_bg = [this, panel_bd_col](bool focused){
|
||||
auto bg_color = StateColor::darkModeColorFor(wxColour(focused ? "#E5F0EE" : "#FFFFFF"));
|
||||
auto panel = p->panel_nozzle_dia;
|
||||
panel->SetBackgroundColor(bg_color);
|
||||
if(focused)
|
||||
panel->SetBorderColor(wxColour("#009688"));
|
||||
else
|
||||
panel->SetBorderColor(panel_bd_col);
|
||||
auto nozzle_focus_bg = [this, panel_color](bool focused){
|
||||
auto bg_color = StateColor::darkModeColorFor(focused ? panel_color.bg_focus : panel_color.bg_normal);
|
||||
p->panel_nozzle_dia->SetBackgroundColor(bg_color);
|
||||
p->panel_nozzle_dia->SetBorderColor(focused ? panel_color.bd_focus : panel_color.bd_normal);
|
||||
p->label_nozzle_title->SetBackgroundColour(bg_color);
|
||||
p->label_nozzle_type->SetBackgroundColour(bg_color);
|
||||
p->combo_nozzle_dia->SetBackgroundColour(bg_color); // paints margins instead combo background
|
||||
|
|
@ -1801,13 +1806,25 @@ Sidebar::Sidebar(Plater *parent)
|
|||
p->combo_nozzle_dia->Bind(wxEVT_SET_FOCUS, [this, nozzle_focus_bg](auto& e) {nozzle_focus_bg(true ); e.Skip();});
|
||||
p->combo_nozzle_dia->Bind(wxEVT_KILL_FOCUS, [this, nozzle_focus_bg](auto& e) {nozzle_focus_bg(false); e.Skip();});
|
||||
|
||||
p->label_nozzle_type = new Label(p->panel_nozzle_dia, "Brass", wxST_ELLIPSIZE_END | wxALIGN_CENTRE_HORIZONTAL);
|
||||
p->label_nozzle_type = new Label(p->panel_nozzle_dia, "Brass", LB_PROPAGATE_MOUSE_EVENT | wxST_ELLIPSIZE_END | wxALIGN_CENTRE_HORIZONTAL);
|
||||
p->label_nozzle_type->SetFont(Label::Body_10);
|
||||
p->label_nozzle_type->SetMinSize(FromDIP(wxSize(56, -1)));
|
||||
p->label_nozzle_type->SetMaxSize(FromDIP(wxSize(56, -1)));
|
||||
p->label_nozzle_type->Bind(wxEVT_LEFT_DOWN, [this](auto & evt) {
|
||||
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, panel_color](wxMouseEvent &e) {
|
||||
if(!p->combo_nozzle_dia->HasFocus())
|
||||
p->panel_nozzle_dia->SetBorderColor(panel_color.bd_hover);
|
||||
e.Skip();
|
||||
});
|
||||
w->Bind(wxEVT_LEAVE_WINDOW, [this, panel_color](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_color.bd_normal);
|
||||
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));
|
||||
|
|
@ -1818,10 +1835,11 @@ Sidebar::Sidebar(Plater *parent)
|
|||
|
||||
// Bed type selection
|
||||
p->panel_printer_bed = new StaticBox(p->m_panel_printer_content);
|
||||
p->panel_printer_bed->SetCornerRadius(FromDIP(8));
|
||||
p->panel_printer_bed->SetBorderColor(panel_bd_col);
|
||||
p->panel_printer_bed->SetCornerRadius(FromDIP(PRINTER_PANEL_RADIUS));
|
||||
p->panel_printer_bed->SetBorderColor(panel_color.bd_normal);
|
||||
p->panel_printer_bed->SetMinSize(FromDIP(PRINTER_PANEL_SIZE));
|
||||
p->panel_printer_bed->Bind(wxEVT_LEFT_DOWN, [this](auto &evt) {
|
||||
on_leave_image_printer_bed(evt);
|
||||
p->combo_printer_bed->wxEvtHandler::ProcessEvent(evt);
|
||||
});
|
||||
|
||||
|
|
@ -1833,10 +1851,7 @@ Sidebar::Sidebar(Plater *parent)
|
|||
ScalableBitmap bitmap_bed(p->panel_printer_bed, "printer_placeholder", PRINTER_THUMBNAIL_SIZE.GetHeight());
|
||||
p->image_printer_bed = new wxStaticBitmap(p->panel_printer_bed, wxID_ANY, bitmap_bed.bmp(), wxDefaultPosition, wxDefaultSize, 0);
|
||||
p->image_printer_bed->Bind(wxEVT_LEFT_DOWN, [this](auto &evt) {
|
||||
p->image_printer_bed->Unbind(wxEVT_LEAVE_WINDOW, &Sidebar::on_leave_image_printer_bed, this);
|
||||
if (p->big_bed_image_popup) {
|
||||
p->big_bed_image_popup->on_hide();
|
||||
}
|
||||
on_leave_image_printer_bed(evt);
|
||||
p->combo_printer_bed->wxEvtHandler::ProcessEvent(evt);
|
||||
});
|
||||
|
||||
|
|
@ -1848,37 +1863,41 @@ Sidebar::Sidebar(Plater *parent)
|
|||
reset_bed_type_combox_choices(true);
|
||||
|
||||
p->combo_printer_bed->Bind(wxEVT_COMBOBOX, [this](auto &e) {
|
||||
bool isDual = static_cast<wxBoxSizer *>(p->panel_printer_preset->GetSizer())->GetOrientation() == wxVERTICAL;
|
||||
auto image_path = get_cur_select_bed_image();
|
||||
p->image_printer_bed->SetBitmap(create_scaled_bitmap(image_path, this, PRINTER_THUMBNAIL_SIZE.GetHeight()));
|
||||
if (p->big_bed_image_popup) {
|
||||
p->big_bed_image_popup->set_bitmap(create_scaled_bitmap("big_" + image_path, p->big_bed_image_popup, p->big_bed_image_popup->get_image_px()));
|
||||
p->big_bed_image_popup->set_title(p->combo_printer_bed->GetString(p->combo_printer_bed->GetSelection()));
|
||||
}
|
||||
e.Skip(); // fix bug:Event spreads to sidebar
|
||||
e.Skip();
|
||||
});
|
||||
p->combo_printer_bed->Bind(wxEVT_LEAVE_WINDOW, [this](wxMouseEvent &evt) {
|
||||
if (p->big_bed_image_popup) {
|
||||
p->big_bed_image_popup->on_hide();
|
||||
}
|
||||
});
|
||||
p->image_printer_bed->Bind(wxEVT_ENTER_WINDOW, &Sidebar::on_enter_image_printer_bed, this);
|
||||
|
||||
// ORCA paint whole combobox on focus
|
||||
auto bed_focus_bg = [this, panel_bd_col](bool focused){
|
||||
auto bg_color = StateColor::darkModeColorFor(wxColour(focused ? "#E5F0EE" : "#FFFFFF"));
|
||||
auto panel = p->panel_printer_bed;
|
||||
panel->SetBackgroundColor(bg_color);
|
||||
if(focused)
|
||||
panel->SetBorderColor(wxColour("#009688"));
|
||||
else
|
||||
panel->SetBorderColor(panel_bd_col);
|
||||
auto bed_focus_bg = [this, panel_color](bool focused){
|
||||
auto bg_color = StateColor::darkModeColorFor(focused ? panel_color.bg_focus : panel_color.bg_normal);
|
||||
p->panel_printer_bed->SetBackgroundColor(bg_color);
|
||||
p->panel_printer_bed->SetBorderColor(focused ? panel_color.bd_focus : panel_color.bd_normal);
|
||||
p->image_printer_bed->SetBackgroundColour(bg_color);
|
||||
p->combo_printer_bed->SetBackgroundColour(bg_color); // paints margins instead combo background
|
||||
};
|
||||
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, w, panel_color](wxMouseEvent &e) {
|
||||
if(!p->combo_printer_bed->HasFocus())
|
||||
p->panel_printer_bed->SetBorderColor(panel_color.bd_hover);
|
||||
if(w == p->image_printer_bed && !p->combo_printer_bed->is_drop_down()) // dont trigger while combo open
|
||||
on_enter_image_printer_bed(e);
|
||||
e.Skip();
|
||||
});
|
||||
w->Bind(wxEVT_LEAVE_WINDOW, [this, w, panel_color](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_color.bd_normal);
|
||||
if(w == p->image_printer_bed)
|
||||
on_leave_image_printer_bed(e);
|
||||
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));
|
||||
|
|
@ -2200,15 +2219,14 @@ Sidebar::Sidebar(Plater *parent)
|
|||
Sidebar::~Sidebar() {}
|
||||
|
||||
void Sidebar::on_enter_image_printer_bed(wxMouseEvent &evt) {
|
||||
p->image_printer_bed->Bind(wxEVT_LEAVE_WINDOW, &Sidebar::on_leave_image_printer_bed, this);
|
||||
//p->image_printer_bed->Bind(wxEVT_LEAVE_WINDOW, &Sidebar::on_leave_image_printer_bed, this);
|
||||
auto pos = p->panel_printer_bed->GetScreenPosition();
|
||||
auto rect = p->panel_printer_bed->GetRect();
|
||||
wxPoint temp_pos(pos.x + rect.GetWidth() + FromDIP(3), pos.y);
|
||||
if (p->big_bed_image_popup == nullptr) {
|
||||
if (p->big_bed_image_popup == nullptr)
|
||||
p->big_bed_image_popup = new ImageDPIFrame();
|
||||
auto image_path = get_cur_select_bed_image();
|
||||
p->big_bed_image_popup->set_bitmap(create_scaled_bitmap("big_" + image_path, p->big_bed_image_popup, p->big_bed_image_popup->get_image_px()));
|
||||
}
|
||||
auto image_path = get_cur_select_bed_image();
|
||||
p->big_bed_image_popup->set_bitmap(create_scaled_bitmap("big_" + image_path, p->big_bed_image_popup, p->big_bed_image_popup->get_image_px()));
|
||||
p->big_bed_image_popup->set_title(p->combo_printer_bed->GetString(p->combo_printer_bed->GetSelection()));
|
||||
p->big_bed_image_popup->SetCanFocus(false);
|
||||
p->big_bed_image_popup->SetPosition(temp_pos);
|
||||
|
|
@ -2216,11 +2234,15 @@ void Sidebar::on_enter_image_printer_bed(wxMouseEvent &evt) {
|
|||
}
|
||||
|
||||
void Sidebar::on_leave_image_printer_bed(wxMouseEvent &evt) {
|
||||
auto pos_x = evt.GetX();
|
||||
auto pos_y = evt.GetY();
|
||||
auto rect = p->image_printer_bed->GetRect();
|
||||
if ((pos_x <= 0 || pos_y <= 0 || pos_x >= rect.GetWidth()) && p->big_bed_image_popup) {
|
||||
//auto pos_x = evt.GetX();
|
||||
//auto pos_y = evt.GetY();
|
||||
//auto rect = p->image_printer_bed->GetRect();
|
||||
//if ((pos_x <= 0 || pos_y <= 0 || pos_x >= rect.GetWidth()) && p->big_bed_image_popup) {
|
||||
if (p->big_bed_image_popup) {
|
||||
bool was_visible = p->big_bed_image_popup->IsShown();
|
||||
p->big_bed_image_popup->on_hide();
|
||||
if(!p->combo_printer_bed->is_drop_down() && was_visible)
|
||||
p->combo_printer_bed->SetFocus(); // set focus back to bed type combo. this prevents weird look if focus on other item
|
||||
}
|
||||
}
|
||||
void Sidebar::on_change_color_mode(bool is_dark) {
|
||||
|
|
@ -2731,18 +2753,19 @@ void Sidebar::msw_rescale()
|
|||
p->m_printer_setting->msw_rescale();
|
||||
|
||||
p->panel_printer_preset->SetMinSize(FromDIP(PRINTER_PANEL_SIZE));
|
||||
p->panel_printer_preset->SetCornerRadius(FromDIP(8));
|
||||
p->panel_printer_preset->SetCornerRadius(FromDIP(PRINTER_PANEL_RADIUS));
|
||||
p->image_printer->SetSize(FromDIP(PRINTER_THUMBNAIL_SIZE));
|
||||
update_printer_thumbnail();
|
||||
p->combo_printer->Rescale();
|
||||
p->combo_printer->SetMaxSize(wxSize(-1, FromDIP(30))); // limiting height makes badge visible
|
||||
p->btn_edit_printer->msw_rescale();
|
||||
|
||||
p->panel_nozzle_dia->SetMinSize(FromDIP(PRINTER_PANEL_SIZE));
|
||||
p->panel_nozzle_dia->SetCornerRadius(FromDIP(8));
|
||||
p->panel_nozzle_dia->SetCornerRadius(FromDIP(PRINTER_PANEL_RADIUS));
|
||||
p->combo_nozzle_dia->Rescale();
|
||||
|
||||
p->panel_printer_bed->SetMinSize(FromDIP(PRINTER_PANEL_SIZE));
|
||||
p->panel_printer_bed->SetCornerRadius(FromDIP(8));
|
||||
p->panel_printer_bed->SetCornerRadius(FromDIP(PRINTER_PANEL_RADIUS));
|
||||
p->combo_printer_bed->Rescale();
|
||||
p->combo_printer_bed->SetMinSize(FromDIP(wxSize(18,-1))); // ORCA show only arrow
|
||||
p->combo_printer_bed->SetMaxSize(FromDIP(wxSize(18,-1))); // ORCA show only arrow
|
||||
|
|
@ -2873,6 +2896,13 @@ void Sidebar::sys_color_changed()
|
|||
p->image_printer->SetSize(FromDIP(PRINTER_THUMBNAIL_SIZE));
|
||||
p->image_printer_bed->SetSize(FromDIP(PRINTER_THUMBNAIL_SIZE));
|
||||
|
||||
// call a kill focus event to ensure new colors applied
|
||||
for (ComboBox* combo : std::vector<ComboBox*>{p->combo_printer, p->combo_nozzle_dia, p->combo_printer_bed}){
|
||||
wxFocusEvent fakeEvent(wxEVT_KILL_FOCUS);
|
||||
fakeEvent.SetEventObject(combo);
|
||||
combo->HandleWindowEvent(fakeEvent);
|
||||
}
|
||||
|
||||
// BBS
|
||||
obj_list()->sys_color_changed();
|
||||
obj_layers()->sys_color_changed();
|
||||
|
|
|
|||
|
|
@ -5121,40 +5121,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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5304,24 +5306,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();
|
||||
|
|
@ -5333,7 +5337,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));
|
||||
|
|
|
|||