Browse Source

Reverse cell painting for Windows

Apparently Windows might not respect painting with a transparent alpha,
so reverse the paint order

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21635
master
Seth Hillbrand 1 month ago
parent
commit
62e220a8db
  1. 13
      include/widgets/grid_striped_renderer.h

13
include/widgets/grid_striped_renderer.h

@ -39,17 +39,12 @@ public:
void Draw( wxGrid& grid, wxGridCellAttr& attr, wxDC& dc,
const wxRect& rect, int row, int col, bool isSelected ) override
{
// First draw the striped background for empty cells
wxString cellValue = grid.GetCellValue( row, col );
// Draw the foreground content using the base renderer first
T::Draw( grid, attr, dc, rect, row, col, isSelected );
if( cellValue.IsEmpty() )
{
// Overlay striped background for empty cells
if( grid.GetCellValue( row, col ).IsEmpty() )
drawStripedBackground( dc, attr, rect, isSelected );
attr.SetBackgroundColour( wxColour( 0, 0, 0, wxALPHA_TRANSPARENT ) );
}
// Then draw the foreground content using the base renderer
T::Draw( grid, attr, dc, rect, row, col, isSelected );
}
wxGridCellRenderer* Clone() const override

Loading…
Cancel
Save