From 1bce9352fbd843ca059e80fd9966d7e5a30f567a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 5 Nov 2026 21:58:56 +0100 Subject: [PATCH] Layout tweaks --- Common/UI/TabHolder.cpp | 2 +- UI/GameScreen.cpp | 1 + UI/MainScreen.cpp | 8 ++++---- UI/MiscScreens.cpp | 3 +++ UI/NativeApp.cpp | 3 +++ UI/SettingsPagesDialogScreen.cpp | 4 ++-- UI/SimpleDialogScreen.cpp | 8 ++++---- UI/TabbedDialogScreen.cpp | 2 +- 8 files changed, 19 insertions(+), 12 deletions(-) diff --git a/Common/UI/TabHolder.cpp b/Common/UI/TabHolder.cpp index 0503fdf497..96a536224c 100644 --- a/Common/UI/TabHolder.cpp +++ b/Common/UI/TabHolder.cpp @@ -42,7 +42,7 @@ TabHolder::TabHolder(Orientation orientation, float stripSize, TabHolderFlags fl Add(tabScroll_); } } else { - SetPadding(Margins(10, 0, 0, 0)); + SetPadding(Margins(12, 0, 0, 0)); tabContainer_ = new LinearLayout(ORIENT_VERTICAL, new LayoutParams(stripSize, FILL_PARENT)); tabContainer_->Add(new Spacer(8.0f)); tabContainer_->SetSpacing(0.0f); diff --git a/UI/GameScreen.cpp b/UI/GameScreen.cpp index ba46ea35b3..c4abce42de 100644 --- a/UI/GameScreen.cpp +++ b/UI/GameScreen.cpp @@ -465,6 +465,7 @@ void GameScreen::CreateContentViews(UI::ViewGroup *parent) { auto di = GetI18NCategory(I18NCat::DIALOG); Choice *btnResetTime = timeHoriz->Add(new Choice(di->T("Reset"), new LinearLayoutParams(0.0f, Gravity::G_VCENTER))); + btnResetTime->SetRoundCorners(); btnResetTime->OnClick.Add([this, ga, timeStr, title](UI::EventParams &) { auto di = GetI18NCategory(I18NCat::DIALOG); auto gta = GetI18NCategory(I18NCat::GAME); diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 4546b094db..507f40a33e 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -532,18 +532,18 @@ void MainScreen::CreateViews() { } if (vertical) { - LinearLayout *header = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, Margins(8, 8, 8, 16))); - header->SetSpacing(5.0f); + LinearLayout *header = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, Margins(0, 12, 0, 16))); + header->SetSpacing(4.0f); header->Add(new LogoView(true, new LinearLayoutParams(1.0f))); LinearLayout *buttonGroup = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(WRAP_CONTENT, WRAP_CONTENT, 1.0f, UI::Gravity::G_VCENTER)); - buttonGroup->SetPadding(Margins(0, 0, 12, 12)); + buttonGroup->SetPadding(Margins(0, 0, 0, 12)); CreateMainButtons(buttonGroup, vertical); header->Add(buttonGroup); - LinearLayout *rootLayout = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(1.0f)); + LinearLayout *rootLayout = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(1.0f, Margins(12, 0, 12, 0))); rootLayout->SetSpacing(0.0f); leftColumn->ReplaceLayoutParams(new LinearLayoutParams(1.0f)); diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index c91f302eb0..c5e981a65f 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -641,6 +641,9 @@ void CreditsScreen::CreateDialogViews(UI::ViewGroup *parent) { System_ShareText(cr->T("CheckOutPPSSPP", "Check out PPSSPP, the awesome PSP emulator: https://www.ppsspp.org/")); }); } + + left->ApplyRoundCorners(); + right->ApplyRoundCorners(); } void CreditsScreen::update() { diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 5d7b9b927e..845b7f5f74 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -910,6 +910,9 @@ void NativeInit(int argc, const char *argv[], const CommandLineOptions &cmdLineO } else if (equals(cmdLineOptions.startScreen.value(), "memsticksetup")) { g_screenManager->switchScreen(new MainScreen()); g_screenManager->push(new MemStickScreen(true)); + } else if (equals(cmdLineOptions.startScreen.value(), "credits")) { + g_screenManager->switchScreen(new MainScreen()); + g_screenManager->push(new CreditsScreen()); } else { WARN_LOG(Log::System, "Unknown start screen '%s'", cmdLineOptions.startScreen.value().c_str()); g_screenManager->switchScreen(new LogoScreen(AfterLogoScreen::DEFAULT)); diff --git a/UI/SettingsPagesDialogScreen.cpp b/UI/SettingsPagesDialogScreen.cpp index 46f5909b2f..ad4bf4488b 100644 --- a/UI/SettingsPagesDialogScreen.cpp +++ b/UI/SettingsPagesDialogScreen.cpp @@ -152,8 +152,8 @@ void SettingsPagesDialogScreen::CreateSettingsTabContents(int settingsTab, UI::L void SettingsPagesDialogScreen::CreateNavBar(UI::ViewGroup *parent, int settingsTab, const std::vector &titles, const std::string &helpTag) { using namespace UI; const SettingsTab &tab = settingsTabs_[settingsTab]; - const Margins barPadding(12, 0, 8, 0); - LinearLayout *bar = parent->Add(new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, ITEM_HEIGHT, Margins(0, 8)))); + const Margins barPadding(12, 0, 12, 0); + LinearLayout *bar = parent->Add(new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, ITEM_HEIGHT, Margins(0, 12)))); bar->SetPadding(barPadding); bar->SetSpacing(8.0f); diff --git a/UI/SimpleDialogScreen.cpp b/UI/SimpleDialogScreen.cpp index f831fedc70..5f6154eb20 100644 --- a/UI/SimpleDialogScreen.cpp +++ b/UI/SimpleDialogScreen.cpp @@ -21,7 +21,7 @@ void UISimpleBaseDialogScreen::CreateViews() { topBarFlags |= TopBarFlags::ContextMenuButton; } - TopBar *topBar = root_->Add(new TopBar(*screenManager()->getUIContext(), topBarFlags, GetTitle())); + TopBar *topBar = root_->Add(new TopBar(*screenManager()->getUIContext(), topBarFlags, GetTitle(), new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, Margins(12, 12, 12, 0)))); if (flags_ & SimpleDialogFlags::CustomContextMenu) { View *menuButton = topBar->GetContextMenuButton(); topBar->OnContextMenuClick.Add([this, menuButton](UI::EventParams &e) { @@ -33,7 +33,7 @@ void UISimpleBaseDialogScreen::CreateViews() { if (flags_ & SimpleDialogFlags::ContentsCanScroll) { ScrollView *scroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT, 1.0f)); - LinearLayout *contents = new LinearLayoutList(ORIENT_VERTICAL, new LinearLayoutParams(Margins(0, 0, portrait ? 0 : 8, 0))); + LinearLayout *contents = new LinearLayoutList(ORIENT_VERTICAL, new LinearLayoutParams(Margins(0, 0, portrait ? 0 : 12, 0))); contents->SetSpacing(0); CreateDialogViews(contents); scroll->Add(contents); @@ -121,13 +121,13 @@ void UITwoPaneBaseDialogScreen::CreateViews() { if (!(flags_ & TwoPaneFlags::SettingsInContextMenu)) { LinearLayout *settingsPane; if (flags_ & TwoPaneFlags::SettingsCanScroll) { - settingsPane = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, Margins(8))); + settingsPane = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)); settingsPane->SetSpacing(0.0f); ScrollView *settingsScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT, 1.0f)); settingsScroll->Add(settingsPane); root->Add(settingsScroll); } else { - settingsPane = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 0.0f, Margins(8))); + settingsPane = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 0.0f)); settingsPane->SetSpacing(0.0f); root->Add(settingsPane); } diff --git a/UI/TabbedDialogScreen.cpp b/UI/TabbedDialogScreen.cpp index e0cd34b111..85ebbcec4f 100644 --- a/UI/TabbedDialogScreen.cpp +++ b/UI/TabbedDialogScreen.cpp @@ -28,7 +28,7 @@ void UITabbedBaseDialogScreen::AddTab(const char *tag, std::string_view title, I scroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT)); scroll->SetTag(tag); } - LinearLayout *contents = new LinearLayoutList(ORIENT_VERTICAL, new LinearLayoutParams(Margins(0, 0, 8, 0))); + LinearLayout *contents = new LinearLayoutList(ORIENT_VERTICAL, new LinearLayoutParams(Margins(0, 0, 12, 0))); contents->SetSpacing(0); if (dialogFlags & TabDialogFlags::AddAutoTitles) {