InputRoll - do not draw column header if not necessary
This commit is contained in:
parent
ae239a0b1d
commit
0e03696b93
|
@ -30,7 +30,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
var lastVisibleRow = firstVisibleRow + CalcVisibleRows(e.ClipRectangle);
|
var lastVisibleRow = firstVisibleRow + CalcVisibleRows(e.ClipRectangle);
|
||||||
CalculateHorizontalColumnPositions(visibleColumns);
|
CalculateHorizontalColumnPositions(visibleColumns);
|
||||||
|
|
||||||
if (visibleColumns.Any())
|
var needsColumnRedraw = HorizontalOrientation || e.ClipRectangle.Y < ColumnHeight;
|
||||||
|
if (visibleColumns.Any() && needsColumnRedraw)
|
||||||
{
|
{
|
||||||
DrawColumnBg(visibleColumns);
|
DrawColumnBg(visibleColumns);
|
||||||
DrawColumnText(visibleColumns);
|
DrawColumnText(visibleColumns);
|
||||||
|
|
|
@ -271,24 +271,28 @@ namespace BizHawk.Client.EmuHawk
|
||||||
// Similarly to ListView in virtual mode, we want to always refresh
|
// Similarly to ListView in virtual mode, we want to always refresh
|
||||||
// when setting row count, that gives the calling code assurance that
|
// when setting row count, that gives the calling code assurance that
|
||||||
// redraw will happen
|
// redraw will happen
|
||||||
|
Redraw();
|
||||||
// TODO: horizontal orientation
|
}
|
||||||
if (HorizontalOrientation)
|
}
|
||||||
{
|
|
||||||
Refresh();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int x = _hBar.Value;
|
|
||||||
int y = ColumnHeight;
|
|
||||||
|
|
||||||
int w = VisibleColumns.Any()
|
public void Redraw()
|
||||||
? Math.Min(VisibleColumns.Max(c => c.Right) - _hBar.Value, Width)
|
{
|
||||||
: 0;
|
// TODO: horizontal orientation
|
||||||
|
if (HorizontalOrientation)
|
||||||
|
{
|
||||||
|
Refresh();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int x = _hBar.Value;
|
||||||
|
int y = ColumnHeight + 1;
|
||||||
|
|
||||||
int h = Height - y;
|
int w = VisibleColumns.Any()
|
||||||
Invalidate(new Rectangle(x, y, w, h));
|
? Math.Min(VisibleColumns.Max(c => c.Right) - _hBar.Value, Width)
|
||||||
}
|
: 0;
|
||||||
|
|
||||||
|
int h = Height - y;
|
||||||
|
Invalidate(new Rectangle(x, y, w, h));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue