diff --git a/src/slic3r/GUI/ConfigWizard.cpp b/src/slic3r/GUI/ConfigWizard.cpp index 127a6417e8..8bf8cd3d7a 100644 --- a/src/slic3r/GUI/ConfigWizard.cpp +++ b/src/slic3r/GUI/ConfigWizard.cpp @@ -1606,25 +1606,17 @@ ConfigWizardIndex::ConfigWizardIndex(wxWindow *parent) , item_hover(NO_ITEM) , last_page((size_t)-1) { +#ifndef __WXOSX__ + SetDoubleBuffered(true);// SetDoubleBuffered exists on Win and Linux/GTK, but is missing on OSX +#endif //__WXOSX__ SetMinSize(bg.bmp().GetSize()); const wxSize size = GetTextExtent("m"); em_w = size.x; em_h = size.y; - // Add logo bitmap. - // This could be done in on_paint() along with the index labels, but I've found it tricky - // to get the bitmap rendered well on all platforms with transparent background. - // In some cases it didn't work at all. And so wxStaticBitmap is used here instead, - // because it has all the platform quirks figured out. - auto *sizer = new wxBoxSizer(wxVERTICAL); - logo = new wxStaticBitmap(this, wxID_ANY, bg.bmp()); - sizer->AddStretchSpacer(); - sizer->Add(logo); - SetSizer(sizer); - logo_height = logo->GetBitmap().GetHeight(); - Bind(wxEVT_PAINT, &ConfigWizardIndex::on_paint, this); + Bind(wxEVT_SIZE, [this](wxEvent& e) { e.Skip(); Refresh(); }); Bind(wxEVT_MOTION, &ConfigWizardIndex::on_mouse_move, this); Bind(wxEVT_LEAVE_WINDOW, [this](wxMouseEvent &evt) { @@ -1769,6 +1761,12 @@ void ConfigWizardIndex::on_paint(wxPaintEvent & evt) y += yinc; index_width = std::max(index_width, (int)x + text_size.x); } + + //draw logo + if (int y = size.y - bg.GetBmpHeight(); y>=0) { + dc.DrawBitmap(bg.bmp(), 0, y, false); + index_width = std::max(index_width, bg.GetBmpWidth() + em_w / 2); + } if (GetMinSize().x < index_width) { CallAfter([this, index_width]() { @@ -1776,11 +1774,6 @@ void ConfigWizardIndex::on_paint(wxPaintEvent & evt) Refresh(); }); } - - if ((int)y + logo_height > size.GetHeight()) - logo->Hide(); - else - logo->Show(); } void ConfigWizardIndex::on_mouse_move(wxMouseEvent &evt) @@ -1806,7 +1799,6 @@ void ConfigWizardIndex::msw_rescale() bg.msw_rescale(); SetMinSize(bg.bmp().GetSize()); - logo->SetBitmap(bg.bmp()); bullet_black.msw_rescale(); bullet_blue.msw_rescale(); diff --git a/src/slic3r/GUI/ConfigWizard_private.hpp b/src/slic3r/GUI/ConfigWizard_private.hpp index ea39e04ab3..6ca0619410 100644 --- a/src/slic3r/GUI/ConfigWizard_private.hpp +++ b/src/slic3r/GUI/ConfigWizard_private.hpp @@ -512,15 +512,12 @@ private: ScalableBitmap bullet_black; ScalableBitmap bullet_blue; ScalableBitmap bullet_white; - wxStaticBitmap* logo; std::vector items; size_t item_active; ssize_t item_hover; size_t last_page; - int logo_height; - int item_height() const { return std::max(bullet_black.bmp().GetSize().GetHeight(), em_w) + em_w; } void on_paint(wxPaintEvent &evt);