Skip to content

Commit

Permalink
Limit height of scrollable lists
Browse files Browse the repository at this point in the history
Now all Option sub-menus can have a bottom link without it being overlapped.

This fixes the translation link being very difficult to click.
  • Loading branch information
KJeff01 committed Feb 6, 2024
1 parent 5242445 commit 9426f09
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/frontend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down
3 changes: 2 additions & 1 deletion src/frontend.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 9426f09

Please sign in to comment.