From b6196e91e4469ae4e0d05df905305d816a7a6ff0 Mon Sep 17 00:00:00 2001 From: TaxiService Date: Sun, 5 Feb 2023 19:00:38 +0100 Subject: [PATCH] increase min scrollbar height to 2 (from 1) rationale: - vanilla scrollbars dont get shorter than 2. - 2-tall 'bars are easier to click on than 1-tall 'bars. - this avoids having to make short custom graphics for 1-tall tiles, which most of the time look terrible... cons: - short scrollbars are cool : ( --- library/lua/gui/widgets.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/lua/gui/widgets.lua b/library/lua/gui/widgets.lua index 429f28e34..71d89846d 100644 --- a/library/lua/gui/widgets.lua +++ b/library/lua/gui/widgets.lua @@ -808,7 +808,7 @@ local function scrollbar_get_max_pos_and_height(scrollbar) local frame_body = scrollbar.frame_body local scrollbar_body_height = (frame_body and frame_body.height or 3) - 2 - local height = math.max(1, math.floor( + local height = math.max(2, math.floor( (math.min(scrollbar.elems_per_page, scrollbar.num_elems) * scrollbar_body_height) / scrollbar.num_elems))