Move the version label on the launcher out of the banner area, to avoid visual clashing (the label might be unreadable, depending on the colors used on the banner graphic, if it ever gets updated)
This commit is contained in:
parent
b1ba81bfcf
commit
8a8764991a
5 changed files with 8 additions and 14 deletions
|
|
@ -9,19 +9,9 @@
|
|||
LauncherBanner::LauncherBanner(Widget* parent) : Widget(parent)
|
||||
{
|
||||
Logo = new ImageBox(this);
|
||||
VersionLabel = new TextLabel(this);
|
||||
VersionLabel->SetTextAlignment(TextLabelAlignment::Right);
|
||||
|
||||
Logo->SetImage(Image::LoadResource("widgets/banner.png"));
|
||||
}
|
||||
|
||||
void LauncherBanner::UpdateLanguage()
|
||||
{
|
||||
FString versionText = GStrings.GetString("PICKER_VERSION");
|
||||
versionText.Substitute("%s", GetVersionString());
|
||||
VersionLabel->SetText(versionText.GetChars());
|
||||
}
|
||||
|
||||
double LauncherBanner::GetPreferredHeight() const
|
||||
{
|
||||
return Logo->GetPreferredHeight();
|
||||
|
|
@ -30,5 +20,4 @@ double LauncherBanner::GetPreferredHeight() const
|
|||
void LauncherBanner::OnGeometryChanged()
|
||||
{
|
||||
Logo->SetFrameGeometry(0.0, 0.0, GetWidth(), Logo->GetPreferredHeight());
|
||||
VersionLabel->SetFrameGeometry(20.0, GetHeight() - 10.0 - VersionLabel->GetPreferredHeight(), GetWidth() - 40.0, VersionLabel->GetPreferredHeight());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ class LauncherBanner : public Widget
|
|||
{
|
||||
public:
|
||||
LauncherBanner(Widget* parent);
|
||||
void UpdateLanguage();
|
||||
|
||||
double GetPreferredHeight() const;
|
||||
|
||||
|
|
@ -17,5 +16,4 @@ private:
|
|||
void OnGeometryChanged() override;
|
||||
|
||||
ImageBox* Logo = nullptr;
|
||||
TextLabel* VersionLabel = nullptr;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ void LauncherWindow::UpdateLanguage()
|
|||
{
|
||||
Pages->SetTabText(PlayGame, GStrings.GetString("PICKER_TAB_PLAY"));
|
||||
Pages->SetTabText(Settings, GStrings.GetString("OPTMNU_TITLE"));
|
||||
Banner->UpdateLanguage();
|
||||
PlayGame->UpdateLanguage();
|
||||
Settings->UpdateLanguage();
|
||||
Buttonbar->UpdateLanguage();
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
PlayGamePage::PlayGamePage(LauncherWindow* launcher, WadStuff* wads, int numwads, int defaultiwad) : Widget(nullptr), Launcher(launcher)
|
||||
{
|
||||
WelcomeLabel = new TextLabel(this);
|
||||
VersionLabel = new TextLabel(this);
|
||||
VersionLabel->SetTextAlignment(TextLabelAlignment::Right);
|
||||
SelectLabel = new TextLabel(this);
|
||||
ParametersLabel = new TextLabel(this);
|
||||
GamesList = new ListView(this);
|
||||
|
|
@ -62,6 +64,9 @@ void PlayGamePage::UpdateLanguage()
|
|||
FString welcomeText = GStrings.GetString("PICKER_WELCOME");
|
||||
welcomeText.Substitute("%s", GAMENAME);
|
||||
WelcomeLabel->SetText(welcomeText.GetChars());
|
||||
FString versionText = GStrings.GetString("PICKER_VERSION");
|
||||
versionText.Substitute("%s", GetVersionString());
|
||||
VersionLabel->SetText(versionText.GetChars());
|
||||
}
|
||||
|
||||
void PlayGamePage::OnGamesListActivated()
|
||||
|
|
@ -81,6 +86,8 @@ void PlayGamePage::OnGeometryChanged()
|
|||
WelcomeLabel->SetFrameGeometry(0.0, y, GetWidth(), WelcomeLabel->GetPreferredHeight());
|
||||
y += WelcomeLabel->GetPreferredHeight();
|
||||
|
||||
VersionLabel->SetFrameGeometry(20.0, y - VersionLabel->GetPreferredHeight(), GetWidth() - 19.0, VersionLabel->GetPreferredHeight());
|
||||
|
||||
y += 10.0;
|
||||
|
||||
SelectLabel->SetFrameGeometry(0.0, y, GetWidth(), SelectLabel->GetPreferredHeight());
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ private:
|
|||
LauncherWindow* Launcher = nullptr;
|
||||
|
||||
TextLabel* WelcomeLabel = nullptr;
|
||||
TextLabel* VersionLabel = nullptr;
|
||||
TextLabel* SelectLabel = nullptr;
|
||||
TextLabel* ParametersLabel = nullptr;
|
||||
ListView* GamesList = nullptr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue