Tweaks to RetroAchievements screen

This commit is contained in:
Henrik Rydgård committed 2026-10-26 23:01:21 +01:00
1 parent 7e2b68cc19
commit 734d56a1d3
4 files changed
+49 -19

No files matched your search

+5 -5
View File
@@ -151,15 +151,14 @@ void SettingsPagesDialogScreen::CreateSettingsTabContents(int settingsTab, UI::L
void SettingsPagesDialogScreen::CreateNavBar(UI::ViewGroup *parent, int settingsTab, const std::vector<std::string> &titles, const std::string &helpTag) {
using namespace UI;
const SettingsTab &tab = settingsTabs_[settingsTab];
// Tall enough for the ITEM_HEIGHT buttons inside the padding, so they're square.
const Margins barPadding(12, 8, 12, 8);
LinearLayout *bar = parent->Add(new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, ITEM_HEIGHT + barPadding.vert(), Margins(0, 0, 8, 0))));
const Margins barPadding(12, 0, 8, 0);
LinearLayout *bar = parent->Add(new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, ITEM_HEIGHT, Margins(0, 8))));
bar->SetPadding(barPadding);
bar->SetSpacing(0.0f);
bar->SetSpacing(8.0f);
// When stacked in portrait, there's no other back button, so it's always there, and leaves the screen from the root page.
if (stacked_ || !searchText_.empty() || !pagePaths_[tab.tag].empty()) {
Choice *backButton = bar->Add(new Choice(ImageID("I_NAVIGATE_BACK"), new LinearLayoutParams(ITEM_HEIGHT, ITEM_HEIGHT)));
Choice *backButton = bar->Add(new Choice(ImageID("I_CHEVRON_LEFT"), new LinearLayoutParams(ITEM_HEIGHT, ITEM_HEIGHT)));
backButton->SetRoundCorners(RoundCorners::All);
backButton->OnClick.Add([this, settingsTab](UI::EventParams &) {
if (!GoBack(settingsTab)) {
@@ -167,6 +166,7 @@ void SettingsPagesDialogScreen::CreateNavBar(UI::ViewGroup *parent, int settings
}
});
}
// Portrait has no room for the whole path, and the back button goes up it.
int firstShownTitle = stacked_ ? (int)titles.size() - 1 : 0;
for (int i = firstShownTitle; i < (int)titles.size(); i++) {