Optimal Export Button

This commit is contained in:
QIDI TECH
2023-10-14 11:13:10 +08:00
parent 25096e7aad
commit edf53d8b0d

View File

@@ -911,8 +911,8 @@ Sidebar::Sidebar(Plater *parent)
// Buttons underneath the scrolled area // Buttons underneath the scrolled area
// rescalable bitmap buttons "Send to printer" and "Remove device" // rescalable bitmap buttons "Send to printer" and "Remove device"
//Y14
auto init_scalable_btn = [this](ScalableButton** btn, const std::string& icon_name, wxString tooltip = wxEmptyString) auto init_scalable_btn = [this](ScalableButton** btn, const std::string& icon_name, wxString label, wxString tooltip = wxEmptyString)
{ {
#ifdef __APPLE__ #ifdef __APPLE__
int bmp_px_cnt = 16; int bmp_px_cnt = 16;
@@ -920,7 +920,8 @@ Sidebar::Sidebar(Plater *parent)
int bmp_px_cnt = 32; int bmp_px_cnt = 32;
#endif //__APPLE__ #endif //__APPLE__
ScalableBitmap bmp = ScalableBitmap(this, icon_name, bmp_px_cnt); ScalableBitmap bmp = ScalableBitmap(this, icon_name, bmp_px_cnt);
*btn = new ScalableButton(this, wxID_ANY, bmp, "", wxBU_EXACTFIT); *btn = new ScalableButton(this, wxID_ANY, bmp, label, wxBU_EXACTFIT);
(*btn)->SetFont(wxGetApp().bold_font());
#ifdef _WIN32 #ifdef _WIN32
(*btn)->Bind(wxEVT_ENTER_WINDOW, [tooltip, btn, this](wxMouseEvent& event) { (*btn)->Bind(wxEVT_ENTER_WINDOW, [tooltip, btn, this](wxMouseEvent& event) {
@@ -937,10 +938,10 @@ Sidebar::Sidebar(Plater *parent)
(*btn)->Hide(); (*btn)->Hide();
}; };
init_scalable_btn(&p->btn_send_gcode , "export_gcode", _L("Send to printer") + " " +GUI::shortkey_ctrl_prefix() + "Shift+G"); init_scalable_btn(&p->btn_send_gcode, "export_gcode", _L("Send to printer"), _L("Send to printer") + " " + GUI::shortkey_ctrl_prefix() + "Shift+G");
// init_scalable_btn(&p->btn_eject_device, "eject_sd" , _L("Remove device ") + GUI::shortkey_ctrl_prefix() + "T"); // init_scalable_btn(&p->btn_eject_device, "eject_sd" , _L("Remove device ") + GUI::shortkey_ctrl_prefix() + "T");
init_scalable_btn(&p->btn_export_gcode_removable, "export_to_sd", _L("Export to SD card / Flash drive") + " " + GUI::shortkey_ctrl_prefix() + "U"); init_scalable_btn(&p->btn_export_gcode_removable, "export_to_sd", _L("Export"), _L("Export to SD card / Flash drive") + " " + GUI::shortkey_ctrl_prefix() + "U");
//Y14
// regular buttons "Slice now" and "Export G-code" // regular buttons "Slice now" and "Export G-code"
// const int scaled_height = p->btn_eject_device->GetBitmapHeight() + 4; // const int scaled_height = p->btn_eject_device->GetBitmapHeight() + 4;