FIX: [STUDIO-2364] use generic render for item selection

Change-Id: Iebda6269b736e25802798fcc128230d4bb87c760
This commit is contained in:
chunmao.guo 2023-03-09 14:23:42 +08:00 committed by Lane.Wei
parent aebbe807f2
commit 8be8f20f75
1 changed files with 14 additions and 0 deletions

View File

@ -34,6 +34,7 @@
#ifdef __WXMSW__
#include "wx/uiaction.h"
#include <wx/renderer.h>
#endif /* __WXMSW__ */
namespace Slic3r
@ -73,6 +74,17 @@ static void take_snapshot(const std::string& snapshot_name)
plater->take_snapshot(snapshot_name);
}
class wxRenderer : public wxDelegateRendererNative
{
public:
wxRenderer() : wxDelegateRendererNative(wxRendererNative::Get()) {}
virtual void DrawItemSelectionRect(wxWindow *win,
wxDC& dc,
const wxRect& rect,
int flags = 0) wxOVERRIDE
{ GetGeneric().DrawItemSelectionRect(win, dc, rect, flags); }
};
ObjectList::ObjectList(wxWindow* parent) :
wxDataViewCtrl(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_MULTIPLE)
{
@ -80,6 +92,8 @@ ObjectList::ObjectList(wxWindow* parent) :
SetFont(Label::sysFont(13));
#ifdef __WXMSW__
GenericGetHeader()->SetFont(Label::sysFont(13));
static auto render = new wxRenderer;
wxRendererNative::Set(render);
#endif
// create control