Increase audio track list window to full-height

This commit is contained in:
NeilClack
2026-08-13 16:17:37 -05:00
parent e774fbfda9
commit 2f014aec8a
+8 -2
View File
@@ -422,7 +422,13 @@ void AudioSettingsPage::renderModal(SDL_Renderer* renderer, float fw, float fh,
{ {
float itemHeight = 45.0f; float itemHeight = 45.0f;
float listY = currentY; float listY = currentY;
int visibleItems = std::min(8, static_cast<int>(items.size()));
// Fill the pop-up down to its bottom edge so as many options fit as
// the box allows. Overflow is clipped at the box bottom instead of
// halfway down the screen.
float listBottom = boxY + boxH - 16.0f;
int visibleItems = std::max(1, std::min(static_cast<int>(items.size()),
static_cast<int>((listBottom - listY) / itemHeight)));
int startIdx = 0; int startIdx = 0;
// Center the visible window around selected index // Center the visible window around selected index
@@ -435,7 +441,7 @@ void AudioSettingsPage::renderModal(SDL_Renderer* renderer, float fw, float fh,
if (modalItems_.size() < static_cast<size_t>(endIdx)) modalItems_.resize(endIdx); if (modalItems_.size() < static_cast<size_t>(endIdx)) modalItems_.resize(endIdx);
for (int i = startIdx; i < endIdx; ++i) { for (int i = startIdx; i < endIdx; ++i) {
if (listY + itemHeight > fh - 80.0f) break; if (listY + itemHeight > listBottom) break;
SDL_Color color = (i == modalSelectedIndex_) ? yellow : white; SDL_Color color = (i == modalSelectedIndex_) ? yellow : white;
if (i == 0 && modalState_ == ModalState::TrackSelector) { if (i == 0 && modalState_ == ModalState::TrackSelector) {