summaryrefslogtreecommitdiff
path: root/src/layout.c
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2024-07-13 11:44:32 -0700
committer3gg <3gg@shellblade.net>2024-07-13 11:44:32 -0700
commit68a3532728b55b73d8bcadb8ccfc1d9396346cd2 (patch)
treec87a636a36f21024032fc5cb5900982957491f95 /src/layout.c
parenta4294e4a94189dffb1fdf99c9a60d87d77272926 (diff)
Basic table scrollbar rendering.main
Diffstat (limited to 'src/layout.c')
-rw-r--r--src/layout.c6
1 files changed, 6 insertions, 0 deletions
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) {
13 return; 13 return;
14 } 14 }
15 15
16 table->height = height;
17
18 // Compute the number of rows that are visible at once.
19 table->num_visible_rows = height / g_ui.font->header.glyph_height;
20 assert(table->num_visible_rows <= table->rows);
21
16 // Determine if there is vertical overflow. This determines whether we need to 22 // Determine if there is vertical overflow. This determines whether we need to
17 // render a scroll bar, in which case room must be made for it. 23 // render a scroll bar, in which case room must be made for it.
18 table->flags.vertical_overflow = 24 table->flags.vertical_overflow =