From 3ef7c2d9e8762ddfb5f49a57d7a274e6762dcf39 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Thu, 16 Oct 2025 11:40:02 +0200 Subject: [PATCH] Fill scrollbar gap in news window if no scrollbar is visible --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/News.cpp | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index ea45c66d42..44cef4dd47 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -12,6 +12,7 @@ - Fix: [#25299] The Mine Train Coaster left large helix draws incorrect sprites at certain angles (original bug). - Fix: [#25328] Spiral Slide in Blackpool Pleasure Beach has its entrance and exit the wrong way round (bug in the original scenario). - Fix: [#25342] The Go-Karts medium right gentle sloped turn does not have a tunnel at the end. +- Fix: [#25349] Items in Recent Messages are too narrow if there is no scrollbar visible. - Fix: [#25350] The scrolling intro background switches colour halfway through (original bug). - Fix: [#25350] When skipping the scrolling intro, the screen does not get cleared properly. - Fix: [#25350] Scrolling intro cannot be skipped using a mouse click. diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index f57c802a04..7ac603638b 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -446,6 +446,10 @@ namespace OpenRCT2::Ui::Windows int32_t i = 0; const auto backgroundPaletteIndex = ColourMapA[colours[3].colour].light; + // Fill the scrollbar gap if no scrollbar is visible + const bool scrollbarVisible = scrolls[0].contentHeight > widgets[WIDX_SCROLL].height(); + const auto scrollbarFill = scrollbarVisible ? 0 : kScrollBarWidth; + for (const auto& newsItem : getGameState().newsItems.GetArchived()) { if (y >= rt.y + rt.height) @@ -458,9 +462,9 @@ namespace OpenRCT2::Ui::Windows } // Outer frame - GfxFillRectInset(rt, { -1, y, 383, y + itemHeight - 1 }, colours[1], INSET_RECT_F_30); + GfxFillRectInset(rt, { -1, y, 383 + scrollbarFill, y + itemHeight - 1 }, colours[1], INSET_RECT_F_30); // Background - GfxFillRect(rt, { 0, y + 1, 381, y + itemHeight - 2 }, backgroundPaletteIndex); + GfxFillRect(rt, { 0, y + 1, 381 + scrollbarFill, y + itemHeight - 2 }, backgroundPaletteIndex); // Date text { @@ -480,7 +484,7 @@ namespace OpenRCT2::Ui::Windows // Subject button if ((newsItem.typeHasSubject()) && !(newsItem.hasButton())) { - auto screenCoords = ScreenCoordsXY{ 328, y + lineHeight + 4 }; + auto screenCoords = ScreenCoordsXY{ 328 + scrollbarFill, y + lineHeight + 4 }; int32_t press = 0; if (_pressedNewsItemIndex != -1) @@ -561,7 +565,7 @@ namespace OpenRCT2::Ui::Windows // Location button if ((newsItem.typeHasLocation()) && !(newsItem.hasButton())) { - auto screenCoords = ScreenCoordsXY{ 352, y + lineHeight + 4 }; + auto screenCoords = ScreenCoordsXY{ 352 + scrollbarFill, y + lineHeight + 4 }; int32_t press = 0; if (_pressedNewsItemIndex != -1)