Draw the active line box on top of the grid columns

This commit is contained in:
Thomas Goyne 2014-04-20 19:39:48 -07:00
parent f14cef7321
commit 5646c05be7

View file

@ -370,15 +370,8 @@ void BaseGrid::OnPaint(wxPaintEvent &) {
} }
// Draw grid // Draw grid
if (curDiag == active_line) { dc.SetPen(grid_pen);
dc.SetPen(wxPen(to_wx(OPT_GET("Colour/Subtitle Grid/Active Border")->GetColor()))); dc.DrawLine(0, y + lineHeight, w , y + lineHeight);
dc.SetBrush(*wxTRANSPARENT_BRUSH);
dc.DrawRectangle(0, y, w, lineHeight + 1);
}
else {
dc.SetPen(grid_pen);
dc.DrawLine(0, y + lineHeight, w , y + lineHeight);
}
dc.SetPen(*wxTRANSPARENT_PEN); dc.SetPen(*wxTRANSPARENT_PEN);
} }
@ -395,6 +388,11 @@ void BaseGrid::OnPaint(wxPaintEvent &) {
dc.DrawLine(0, 0, 0, maxH); dc.DrawLine(0, 0, 0, maxH);
dc.DrawLine(w - 1, 0, w - 1, maxH); dc.DrawLine(w - 1, 0, w - 1, maxH);
} }
if (active_line && active_line->Row >= yPos && active_line->Row < yPos + nDraw) {
dc.SetPen(wxPen(to_wx(OPT_GET("Colour/Subtitle Grid/Active Border")->GetColor())));
dc.SetBrush(*wxTRANSPARENT_BRUSH);
dc.DrawRectangle(0, (active_line->Row - yPos + 1) * lineHeight, w, lineHeight + 1);
}
} }
void BaseGrid::OnSize(wxSizeEvent &) { void BaseGrid::OnSize(wxSizeEvent &) {