mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-21 19:51:27 +00:00
Add support for changing the tab labels
This commit is contained in:
parent
53c6002746
commit
63f1326e62
3 changed files with 46 additions and 0 deletions
|
@ -21,6 +21,11 @@ public:
|
|||
int AddTab(Widget* page, const std::string& label);
|
||||
int AddTab(Widget* page, const std::shared_ptr<Image>& icon, const std::string& label);
|
||||
|
||||
void SetTabText(int index, const std::string& text);
|
||||
void SetTabText(Widget* page, const std::string& text);
|
||||
void SetTabIcon(int index, const std::shared_ptr<Image>& icon);
|
||||
void SetTabIcon(Widget* page, const std::shared_ptr<Image>& icon);
|
||||
|
||||
int GetCurrentIndex() const;
|
||||
Widget* GetCurrentWidget() const;
|
||||
|
||||
|
@ -51,6 +56,9 @@ public:
|
|||
int AddTab(const std::string& label);
|
||||
int AddTab(const std::shared_ptr<Image>& icon, const std::string& label);
|
||||
|
||||
void SetTabText(int index, const std::string& text);
|
||||
void SetTabIcon(int index, const std::shared_ptr<Image>& icon);
|
||||
|
||||
int GetCurrentIndex() const;
|
||||
void SetCurrentIndex(int pageIndex);
|
||||
|
||||
|
|
|
@ -30,6 +30,30 @@ int TabWidget::AddTab(Widget* page, const std::shared_ptr<Image>& icon, const st
|
|||
return pageIndex;
|
||||
}
|
||||
|
||||
void TabWidget::SetTabText(int index, const std::string& text)
|
||||
{
|
||||
Bar->SetTabText(index, text);
|
||||
}
|
||||
|
||||
void TabWidget::SetTabText(Widget* page, const std::string& text)
|
||||
{
|
||||
int index = GetPageIndex(page);
|
||||
if (index != -1)
|
||||
SetTabText(index, text);
|
||||
}
|
||||
|
||||
void TabWidget::SetTabIcon(int index, const std::shared_ptr<Image>& icon)
|
||||
{
|
||||
Bar->SetTabIcon(index, icon);
|
||||
}
|
||||
|
||||
void TabWidget::SetTabIcon(Widget* page, const std::shared_ptr<Image>& icon)
|
||||
{
|
||||
int index = GetPageIndex(page);
|
||||
if (index != -1)
|
||||
SetTabIcon(index, icon);
|
||||
}
|
||||
|
||||
int TabWidget::GetCurrentIndex() const
|
||||
{
|
||||
return Bar->GetCurrentIndex();
|
||||
|
@ -113,6 +137,18 @@ int TabBar::AddTab(const std::shared_ptr<Image>& icon, const std::string& label)
|
|||
return pageIndex;
|
||||
}
|
||||
|
||||
void TabBar::SetTabText(int index, const std::string& text)
|
||||
{
|
||||
Tabs[index]->SetText(text);
|
||||
OnGeometryChanged();
|
||||
}
|
||||
|
||||
void TabBar::SetTabIcon(int index, const std::shared_ptr<Image>& icon)
|
||||
{
|
||||
Tabs[index]->SetIcon(icon);
|
||||
OnGeometryChanged();
|
||||
}
|
||||
|
||||
int TabBar::GetCurrentIndex() const
|
||||
{
|
||||
return CurrentIndex;
|
||||
|
|
|
@ -72,6 +72,8 @@ void LauncherWindow::Exit()
|
|||
|
||||
void LauncherWindow::UpdateLanguage()
|
||||
{
|
||||
// Pages->SetTabText(PlayGame, GStrings("PICKER_TAB_PLAY"));
|
||||
// Pages->SetTabText(Settings, GStrings("PICKER_TAB_SETTINGS"));
|
||||
Banner->UpdateLanguage();
|
||||
PlayGame->UpdateLanguage();
|
||||
Settings->UpdateLanguage();
|
||||
|
|
Loading…
Reference in a new issue