mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-23 23:04:36 +01:00
Introduce widget::width and widget::height helper functions (#12053)
This commit is contained in:
@@ -749,7 +749,7 @@ static void window_loadsave_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
static void window_loadsave_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex)
|
||||
{
|
||||
gfx_fill_rect(dpi, dpi->x, dpi->y, dpi->x + dpi->width - 1, dpi->y + dpi->height - 1, ColourMapA[w->colours[1]].mid_light);
|
||||
const int32_t listWidth = w->widgets[WIDX_SCROLL].right - w->widgets[WIDX_SCROLL].left;
|
||||
const int32_t listWidth = w->widgets[WIDX_SCROLL].width();
|
||||
const int32_t dateAnchor = w->widgets[WIDX_SORT_DATE].left + maxDateWidth + DATE_TIME_GAP;
|
||||
|
||||
for (int32_t i = 0; i < w->no_list_items; i++)
|
||||
@@ -781,7 +781,7 @@ static void window_loadsave_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i
|
||||
auto ft = Formatter::Common();
|
||||
ft.Add<rct_string_id>(STR_STRING);
|
||||
ft.Add<char*>(_listItems[i].name.c_str());
|
||||
int32_t max_file_width = w->widgets[WIDX_SORT_NAME].right - w->widgets[WIDX_SORT_NAME].left - 10;
|
||||
int32_t max_file_width = w->widgets[WIDX_SORT_NAME].width() - 10;
|
||||
gfx_draw_string_left_clipped(dpi, stringId, gCommonFormatArgs, COLOUR_BLACK, { 10, y }, max_file_width);
|
||||
|
||||
// Print formatted modified date, if this is a file
|
||||
|
||||
Reference in New Issue
Block a user