From beb5db0e697edb2f37ec880b8fe386fbe6c61c48 Mon Sep 17 00:00:00 2001 From: KJeff01 Date: Mon, 5 Feb 2024 12:43:27 -0600 Subject: [PATCH] Limit height of scrollable lists Now all Option sub-menus can have a bottom link without it being overlapped. This fixes the translation link being very difficult to click. --- src/frontend.cpp | 14 +++++++------- src/frontend.h | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/frontend.cpp b/src/frontend.cpp index eb90250426a..20265e0ac25 100644 --- a/src/frontend.cpp +++ b/src/frontend.cpp @@ -738,7 +738,7 @@ void startOptionsMenu() addTextButton(FRONTEND_MUSICMANAGER, _("Music Manager"), WBUT_TXTCENTRE); addTextButton(FRONTEND_MULTIPLAYOPTIONS, _("Multiplay Options"), WBUT_TXTCENTRE); - scrollableList->setGeometry(0, FRONTEND_POS2Y, FRONTEND_BOTFORMW - 1, FRONTEND_POS9Y - FRONTEND_POS2Y); + scrollableList->setGeometry(0, FRONTEND_POS2Y, FRONTEND_BOTFORMW - 1, FRONTEND_BOTFORMH - FRONTEND_BUTHEIGHT_LIST_SPACER); parent->attach(scrollableList); addSideText(FRONTEND_SIDETEXT, FRONTEND_SIDEX, FRONTEND_SIDEY, _("OPTIONS")); @@ -1250,7 +1250,7 @@ void startGraphicsOptionsMenu() grid->setGeometry(0, 0, FRONTEND_BUTWIDTH, grid->idealHeight()); auto scrollableList = ScrollableListWidget::make(); - scrollableList->setGeometry(0, FRONTEND_POS2Y, FRONTEND_BOTFORMW - 1, FRONTEND_BOTFORMH - FRONTEND_POS2Y - 1); + scrollableList->setGeometry(0, FRONTEND_POS2Y, FRONTEND_BOTFORMW - 1, FRONTEND_BOTFORMH - FRONTEND_BUTHEIGHT_LIST_SPACER); scrollableList->addItem(grid); parent->attach(scrollableList); @@ -1484,7 +1484,7 @@ void startAudioAndZoomOptionsMenu() grid->setGeometry(0, 0, FRONTEND_BUTWIDTH, grid->idealHeight()); auto scrollableList = ScrollableListWidget::make(); - scrollableList->setGeometry(0, FRONTEND_POS2Y, FRONTEND_BOTFORMW - 1, FRONTEND_BOTFORMH - FRONTEND_POS2Y - 1); + scrollableList->setGeometry(0, FRONTEND_POS2Y, FRONTEND_BOTFORMW - 1, FRONTEND_BOTFORMH - FRONTEND_BUTHEIGHT_LIST_SPACER); scrollableList->addItem(grid); parent->attach(scrollableList); @@ -2248,7 +2248,7 @@ void startVideoOptionsMenu() grid->setGeometry(0, 0, FRONTEND_BUTWIDTH, grid->idealHeight()); auto scrollableList = ScrollableListWidget::make(); - scrollableList->setGeometry(0, FRONTEND_POS2Y, FRONTEND_BOTFORMW - 1, FRONTEND_BOTFORMH - FRONTEND_POS2Y - 1); + scrollableList->setGeometry(0, FRONTEND_POS2Y, FRONTEND_BOTFORMW - 1, FRONTEND_BOTFORMH - FRONTEND_BUTHEIGHT_LIST_SPACER); scrollableList->addItem(grid); parent->attach(scrollableList); @@ -2548,7 +2548,7 @@ void startMouseOptionsMenu() grid->setGeometry(0, 0, FRONTEND_BUTWIDTH, grid->idealHeight()); auto scrollableList = ScrollableListWidget::make(); - scrollableList->setGeometry(0, FRONTEND_POS2Y, FRONTEND_BOTFORMW - 1, FRONTEND_BOTFORMH - FRONTEND_POS2Y - 1); + scrollableList->setGeometry(0, FRONTEND_POS2Y, FRONTEND_BOTFORMW - 1, FRONTEND_BOTFORMH - FRONTEND_BUTHEIGHT_LIST_SPACER); scrollableList->addItem(grid); parent->attach(scrollableList); @@ -2989,7 +2989,7 @@ void startGameOptionsMenu() grid->setGeometry(0, 0, FRONTEND_BUTWIDTH_WIDE, grid->idealHeight()); auto scrollableList = ScrollableListWidget::make(); - scrollableList->setGeometry(0, FRONTEND_POS2Y, FRONTEND_BOTFORM_WIDEW - 1, FRONTEND_BOTFORM_WIDEH - FRONTEND_POS2Y - 1); + scrollableList->setGeometry(0, FRONTEND_POS2Y, FRONTEND_BOTFORM_WIDEW - 1, FRONTEND_BOTFORM_WIDEH - FRONTEND_BUTHEIGHT_LIST_SPACER); scrollableList->addItem(grid); widgGetFromID(psWScreen, FRONTEND_BOTFORM)->attach(scrollableList); @@ -3428,7 +3428,7 @@ void startMultiplayOptionsMenu() grid->setGeometry(0, 0, FRONTEND_BUTWIDTH, grid->idealHeight()); auto scrollableList = ScrollableListWidget::make(); - scrollableList->setGeometry(0, FRONTEND_POS2Y, FRONTEND_BOTFORMW - 1, FRONTEND_BOTFORMH - FRONTEND_POS2Y - 1); + scrollableList->setGeometry(0, FRONTEND_POS2Y, FRONTEND_BOTFORMW - 1, FRONTEND_BOTFORMH - FRONTEND_BUTHEIGHT_LIST_SPACER); scrollableList->addItem(grid); parent->attach(scrollableList); diff --git a/src/frontend.h b/src/frontend.h index 868ebe5e78c..ee33ff5dc93 100644 --- a/src/frontend.h +++ b/src/frontend.h @@ -170,10 +170,11 @@ struct DisplayTextOptionCache #define FRONTEND_BOTFORM_WIDEW 580 #define FRONTEND_BOTFORM_WIDEH FRONTEND_BOTFORMH // keep Y+H < 480 (minimum display height) - #define FRONTEND_BUTWIDTH FRONTEND_BOTFORMW-40 // text button sizes. #define FRONTEND_BUTHEIGHT 35 +#define FRONTEND_BUTHEIGHT_LIST_SPACER (FRONTEND_BUTHEIGHT + 15) + #define FRONTEND_BUTWIDTH_WIDE FRONTEND_BOTFORM_WIDEW-40 // text button sizes. #define FRONTEND_BUTHEIGHT_WIDE FRONTEND_BUTHEIGHT