mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-16 02:59:49 +01:00
Settings: Make the navigation bar fit square buttons, use chevrons between path parts
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
8e72082d3e
commit
49115bed93
1 file changed
+6
-3
@@ -151,8 +151,10 @@ 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];
|
||||
LinearLayout *bar = parent->Add(new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, ITEM_HEIGHT, Margins(0, 0, 8, 0))));
|
||||
bar->SetPadding(Margins(12, 8, 12, 8));
|
||||
// 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))));
|
||||
bar->SetPadding(barPadding);
|
||||
bar->SetSpacing(0.0f);
|
||||
|
||||
// When stacked in portrait, there's no other back button, so it's always there, and leaves the screen from the root page.
|
||||
@@ -169,7 +171,8 @@ void SettingsPagesDialogScreen::CreateNavBar(UI::ViewGroup *parent, int settings
|
||||
int firstShownTitle = stacked_ ? (int)titles.size() - 1 : 0;
|
||||
for (int i = firstShownTitle; i < (int)titles.size(); i++) {
|
||||
if (i > firstShownTitle) {
|
||||
bar->Add(new TextView(">", new LinearLayoutParams(0.0f, Gravity::G_VCENTER, Margins(4, 0, 4, 0))));
|
||||
ImageView *separator = bar->Add(new ImageView(ImageID("I_CHEVRON_RIGHT"), "", new LinearLayoutParams(0.0f, Gravity::G_VCENTER, Margins(4, 0, 4, 0))));
|
||||
separator->SetScale(0.66f);
|
||||
}
|
||||
if (i == (int)titles.size() - 1) {
|
||||
SimpleTextView *title = bar->Add(new SimpleTextView(titles[i], new LinearLayoutParams(0.0f, Gravity::G_VCENTER)));
|
||||
|
||||
Reference in new issue
Block a user