957 {
962
963 wxPanel* row = new wxPanel(parent, wxID_ANY, wxDefaultPosition, wxSize(-1, row_h),
964 wxTAB_TRAVERSAL | wxFULL_REPAINT_ON_RESIZE);
965 row->SetBackgroundColour(row_bg);
966 row->SetBackgroundStyle(wxBG_STYLE_PAINT);
967 row->SetCursor(wxCursor(wxCURSOR_HAND));
968
970 row->Bind(wxEVT_PAINT, [this, row_bg, checked_bg, text_fg, accent, mode, row_idx](wxPaintEvent& e) {
971 auto* p = static_cast<wxPanel*>(e.GetEventObject());
972 wxAutoBufferedPaintDC dc(p);
973 wxSize sz = p->GetClientSize();
976
977
978 dc.SetBrush(wxBrush(selected ? checked_bg : row_bg));
979 dc.SetPen(hovered ? wxPen(accent) : *wxTRANSPARENT_PEN);
980 dc.DrawRectangle(0, 0, sz.x, sz.y);
981
982 wxFont font = p->GetFont();
984 dc.SetFont(font);
985 dc.SetTextForeground(text_fg);
987 wxSize tsz = dc.GetTextExtent(label);
988 dc.DrawText(label, p->FromDIP(12), (sz.y - tsz.y) / 2);
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002 });
1003
1004 row->Bind(wxEVT_MOTION, [
this, row, row_idx](
wxMouseEvent& evt) {
1007 row->Refresh();
1008 }
1009 evt.Skip();
1010 });
1011 row->Bind(wxEVT_LEAVE_WINDOW, [
this, row](
wxMouseEvent& evt) {
1013 row->Refresh();
1014 evt.Skip();
1015 });
1016 row->Bind(wxEVT_LEFT_DOWN, [
this, mode](
wxMouseEvent&) {
1019 Dismiss();
1020 });
1021
1022 return row;
1023 }
static wxColour texture_import_text_colour()
Definition TextureImportDialog.cpp:92
wxMouseEvent
Definition CameraPopup.cpp:47
static wxString auto_mix_mode_label(TextureAutoMixMode mode)
Definition TextureImportDialog.cpp:483
@ hovered
Definition GLGizmoEmboss.cpp:223