From 68a3532728b55b73d8bcadb8ccfc1d9396346cd2 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sat, 13 Jul 2024 11:44:32 -0700 Subject: Basic table scrollbar rendering. --- src/layout.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/layout.c') diff --git a/src/layout.c b/src/layout.c index 9d4b556..f83976f 100644 --- a/src/layout.c +++ b/src/layout.c @@ -13,6 +13,12 @@ static void ResizeTable(uiTable* table, int width, int height) { return; } + table->height = height; + + // Compute the number of rows that are visible at once. + table->num_visible_rows = height / g_ui.font->header.glyph_height; + assert(table->num_visible_rows <= table->rows); + // Determine if there is vertical overflow. This determines whether we need to // render a scroll bar, in which case room must be made for it. table->flags.vertical_overflow = -- cgit v1.2.3