Skip to content

Commit ec8c646

Browse files
committed
Small improvements in the credits screen
- No longer generate a translatable string for the 'supertuxkart.net' text that is displayed as a nice text for the website button - Fix #5585
1 parent 5e227c5 commit ec8c646

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

data/gui/screens/credits.stkgui

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,21 @@
22
<stkgui>
33
<icon-button id="back" x="1%" y="0" height="9%" icon="gui/icons/back.png"/>
44
<div x="0%" y="1%" width="99%" height="fit" layout="vertical-row">
5-
<button id="stk-website" height="fit" align="right" text="supertuxkart.net"/>
5+
<!-- The text will be set in code to simplify potential updates of the URL
6+
and avoid generating a spurious string for translators. -->
7+
<button id="stk-website" height="fit" align="right" />
68
</div>
79

810
<div x="2%" y="2%" width="96%" height="96%" layout="vertical-row" >
911
<icon id="logo" align="center" proportion="4" width="100%" icon="gui/icons/logo_slim.png"/>
1012

1113
<div x="0" y="0" width="100%" proportion="1" layout="horizontal-row" >
1214

13-
<header I18N="Title in credits screen" text="Credits" />
15+
<header proportion="2" I18N="Title in credits screen" text="Credits" />
1416

15-
<spacer proportion="1" />
17+
<spacer proportion="5" />
1618

17-
<button id="donate" width="fit" align="center" text="Donate"/>
19+
<button proportion="2" id="donate" width="fit" align="center" text="Donate"/>
1820

1921
</div>
2022

src/states_screens/credits.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ using irr::core::stringc;
2828
#include "guiengine/scalable_font.hpp"
2929
#include "guiengine/screen.hpp"
3030
#include "guiengine/widget.hpp"
31+
#include "guiengine/widgets/button_widget.hpp"
3132
#include "io/file_manager.hpp"
3233
#include "online/link_helper.hpp"
3334
#include "states_screens/state_manager.hpp"
@@ -217,6 +218,11 @@ void CreditsScreen::loadedFromFile()
217218
void CreditsScreen::init()
218219
{
219220
Screen::init();
221+
222+
GUIEngine::ButtonWidget *link = getWidget<GUIEngine::ButtonWidget>("stk-website");
223+
link->setText("supertuxkart.net");
224+
onResize(); // Ensure the icon-button is properly sized
225+
220226
reset();
221227
updateAreaSize();
222228
} // init

0 commit comments

Comments
 (0)