GameSettingsScreen: Add tab icons. In portrait mode, use only icons on the tabs.

This commit is contained in:
Henrik Rydgård
2025-11-05 15:19:22 +01:00
parent 75020e2ed7
commit 48ba3d99d3
9 changed files with 182 additions and 140 deletions

View File

@@ -53,12 +53,21 @@ void UITabbedBaseDialogScreen::CreateViews() {
if (portrait) {
auto di = GetI18NCategory(I18NCat::DIALOG);
LinearLayout *verticalLayout = new LinearLayout(ORIENT_VERTICAL, new LayoutParams(FILL_PARENT, FILL_PARENT));
tabHolder_ = new TabHolder(ORIENT_HORIZONTAL, 200, TabHolderFlags::BackButton, filterNotice_, new LinearLayoutParams(1.0f));
TabHolderFlags tabHolderFlags = TabHolderFlags::BackButton;
if (flags_ & TabDialogFlags::HorizontalOnlyIcons) {
tabHolderFlags |= TabHolderFlags::HorizontalOnlyIcons;
}
tabHolder_ = new TabHolder(ORIENT_HORIZONTAL, 200, tabHolderFlags, filterNotice_, new LinearLayoutParams(1.0f));
verticalLayout->Add(tabHolder_);
CreateExtraButtons(verticalLayout, 0);
root_->Add(verticalLayout);
} else {
tabHolder_ = new TabHolder(ORIENT_VERTICAL, 200, TabHolderFlags::Default, filterNotice_, new AnchorLayoutParams(10, 0, 10, 0, false));
TabHolderFlags tabHolderFlags = TabHolderFlags::Default;
if (flags_ & TabDialogFlags::VerticalShowIcons) {
tabHolderFlags |= TabHolderFlags::VerticalShowIcons;
}
tabHolder_ = new TabHolder(ORIENT_VERTICAL, 300, tabHolderFlags, filterNotice_, new AnchorLayoutParams(10, 0, 10, 0, false));
CreateExtraButtons(tabHolder_->Container(), 10);
tabHolder_->AddBack(this);
root_->Add(tabHolder_);