1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 23:34:37 +01:00

Rename ScrollBar struct to ScrollArea and rename its properties (#22539)

This commit is contained in:
Aaron van Geffen
2024-08-11 16:21:53 +02:00
committed by GitHub
parent 00be5b0d63
commit aa7eb18d78
28 changed files with 223 additions and 209 deletions

View File

@@ -433,9 +433,9 @@ ScreenSize CustomListView::GetSize()
auto left = result.width - widget->right + widget->left + 21;
if (left < 0)
left = 0;
if (left < scroll.h_left)
if (left < scroll.contentOffsetX)
{
scroll.h_left = left;
scroll.contentOffsetX = left;
Invalidate();
}
@@ -443,9 +443,9 @@ ScreenSize CustomListView::GetSize()
auto top = result.height - widget->bottom + widget->top + 21;
if (top < 0)
top = 0;
if (top < scroll.v_top)
if (top < scroll.contentOffsetY)
{
scroll.v_top = top;
scroll.contentOffsetY = top;
Invalidate();
}
}
@@ -549,7 +549,7 @@ void CustomListView::MouseUp(const ScreenCoordsXY& pos)
}
}
void CustomListView::Paint(WindowBase* w, DrawPixelInfo& dpi, const ScrollBar* scroll) const
void CustomListView::Paint(WindowBase* w, DrawPixelInfo& dpi, const ScrollArea* scroll) const
{
auto paletteIndex = ColourMapA[w->colours[1].colour].mid_light;
GfxFillRect(dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width, dpi.y + dpi.height } }, paletteIndex);
@@ -638,7 +638,7 @@ void CustomListView::Paint(WindowBase* w, DrawPixelInfo& dpi, const ScrollBar* s
if (ShowColumnHeaders)
{
y = scroll->v_top;
y = scroll->contentOffsetY;
auto bgColour = ColourMapA[w->colours[1].colour].mid_light;
GfxFillRect(dpi, { { dpi.x, y }, { dpi.x + dpi.width, y + 12 } }, bgColour);
@@ -771,7 +771,7 @@ std::optional<RowColumn> CustomListView::GetItemIndexAt(const ScreenCoordsXY& po
{
// Check if we pressed the header
auto& scroll = ParentWindow->scrolls[ScrollIndex];
int32_t absoluteY = pos.y - scroll.v_top;
int32_t absoluteY = pos.y - scroll.contentOffsetY;
if (ShowColumnHeaders && absoluteY >= 0 && absoluteY < kListRowHeight)
{
result = RowColumn();