Implemented caching of often rendered bitmaps on the Tab UI.

This commit is contained in:
bubnikv 2018-04-16 11:03:08 +02:00
parent b881ae936f
commit c18b28e27c
6 changed files with 76 additions and 39 deletions

View file

@ -26,16 +26,16 @@ namespace Slic3r { namespace GUI {
m_Undo_btn->SetBackgroundColour(color);
m_Undo_to_sys_btn->SetBackgroundColour(color);
}
m_Undo_btn->SetBitmap(wxBitmap(from_u8(var("bullet_white.png")), wxBITMAP_TYPE_PNG));
// m_Undo_btn->SetBitmap(wxBitmap(from_u8(var("bullet_white.png")), wxBITMAP_TYPE_PNG));
m_Undo_btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent){ on_back_to_initial_value(); }));
m_Undo_to_sys_btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent){ on_back_to_sys_value(); }));
BUILD();
}
void Field::set_nonsys_btn_icon(const std::string& icon){
m_Undo_to_sys_btn->SetBitmap(wxBitmap(from_u8(var(icon)), wxBITMAP_TYPE_PNG));
}
// void Field::set_nonsys_btn_icon(const wxBitmap& icon){
// m_Undo_to_sys_btn->SetBitmap(icon);
// }
void Field::on_kill_focus(wxEvent& event) {
// Without this, there will be nasty focus bugs on Windows.