diff --git a/Common/UI/PopupScreens.cpp b/Common/UI/PopupScreens.cpp index 4a27d80fe0..4db4ab4114 100644 --- a/Common/UI/PopupScreens.cpp +++ b/Common/UI/PopupScreens.cpp @@ -240,7 +240,7 @@ void PopupScreen::CreateViews() { box_->SetRoundCorners(RoundCorners::All); // Rounds the top of the header and the bottom of the last view, to match the box. - box_->ApplyRoundCorners(RoundCorners::All); + box_->SetRoundCorners(RoundCorners::All); } void MessagePopupScreen::CreatePopupContents(UI::ViewGroup *parent) { @@ -692,7 +692,7 @@ void SliderPopupScreen::CreatePopupContents(UI::ViewGroup *parent) { if (!negativeLabel_.empty()) vert->Add(new CheckBox(&disabled_, negativeLabel_)); - lin->ApplyRoundCorners(); + lin->SetRoundCorners(); if (IsFocusMovementEnabled()) UI::SetFocusedView(slider_, FocusFlags::CAUSE_SCREEN_CHANGE); @@ -738,7 +738,7 @@ void SliderFloatPopupScreen::CreatePopupContents(UI::ViewGroup *parent) { }); reset->SetRoundCorners(); } - lin->ApplyRoundCorners(); + lin->SetRoundCorners(); // slider_ = parent->Add(new SliderFloat(&sliderValue_, minValue_, maxValue_, new LinearLayoutParams(UI::Margins(10, 5)))); if (IsFocusMovementEnabled()) diff --git a/Common/UI/ScrollView.cpp b/Common/UI/ScrollView.cpp index e391b38a74..f6c57dfd42 100644 --- a/Common/UI/ScrollView.cpp +++ b/Common/UI/ScrollView.cpp @@ -674,7 +674,7 @@ void ListView::CreateAllItems() { OnItemCallback(i, e); }); } - linLayout_->ApplyRoundCorners(); + linLayout_->SetRoundCorners(); } void ListView::Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec vert) { diff --git a/Common/UI/TabHolder.cpp b/Common/UI/TabHolder.cpp index 96a536224c..e540f08f2b 100644 --- a/Common/UI/TabHolder.cpp +++ b/Common/UI/TabHolder.cpp @@ -86,7 +86,7 @@ void TabHolder::AddTabContents(std::string_view title, ImageID imageId, ViewGrou } else { tabStrip_->AddChoice(title); } - tabStrip_->ApplyRoundCorners(orientation_ == Orientation::ORIENT_HORIZONTAL ? RoundCorners::Left : RoundCorners::Top); + tabStrip_->SetRoundCorners(orientation_ == Orientation::ORIENT_HORIZONTAL ? RoundCorners::Left : RoundCorners::Top); contents_->Add(tabContents); if (tabs_.size() > 1) @@ -108,7 +108,7 @@ void TabHolder::AddTabDeferred(std::string_view title, ImageID imageId, std::fun } else { tabStrip_->AddChoice(title); } - tabStrip_->ApplyRoundCorners(orientation_ == Orientation::ORIENT_HORIZONTAL ? RoundCorners::Left : RoundCorners::Top); + tabStrip_->SetRoundCorners(orientation_ == Orientation::ORIENT_HORIZONTAL ? RoundCorners::Left : RoundCorners::Top); tabTweens_.push_back(nullptr); createFuncs_.push_back(createCb); diff --git a/Common/UI/View.h b/Common/UI/View.h index 63f1e1f488..6f5a8cbfdd 100644 --- a/Common/UI/View.h +++ b/Common/UI/View.h @@ -878,6 +878,7 @@ protected: class InfoItem : public Item { public: + // If you pass an empty string for rightText, it will be left blank. InfoItem(std::string_view text, std::string_view rightText, LayoutParams *layoutParams = nullptr); InfoItem(std::string_view text, int rightValue, LayoutParams *layoutParams = nullptr); diff --git a/Common/UI/ViewGroup.cpp b/Common/UI/ViewGroup.cpp index 502e167b06..b9ac9046ea 100644 --- a/Common/UI/ViewGroup.cpp +++ b/Common/UI/ViewGroup.cpp @@ -852,7 +852,7 @@ void LinearLayout::Layout() { // Applies rounding to the corners of the child views, based on their position in the layout and the orientation. Masked by the outerCorners. // Ignores invisible views. -void LinearLayout::ApplyRoundCorners(RoundCorners outerCorners) { +void LinearLayout::SetRoundCorners(RoundCorners outerCorners) { // Easy case first: There's spacing, just apply round corners to all subviews. if (spacing_ > 0.0f) { for (View *view : views_) { @@ -916,7 +916,7 @@ void ChoiceGroup::Draw(UIContext &dc) { // Maybe we should require the user to Finish() the ChoiceGroup instead of running this every frame. // At least it's not recursive. - ApplyRoundCorners(RoundCorners::All); + SetRoundCorners(RoundCorners::All); // Draw a roundrect as background. LinearLayout::Draw(dc); diff --git a/Common/UI/ViewGroup.h b/Common/UI/ViewGroup.h index f71c4331b3..717077762a 100644 --- a/Common/UI/ViewGroup.h +++ b/Common/UI/ViewGroup.h @@ -232,9 +232,9 @@ public: contentGravity_ = gravity; } - // Applies rounding to the corners of the child views, based on their position in the layout and the orientation. Masked by the outerCorners. + // Override, applies rounding to the corners of the child views, based on their position in the layout and the orientation. Masked by the outerCorners. // Note that if the view's spacing is not 0.0f, all views will get the rounded corners since they will appear separate. - void ApplyRoundCorners(RoundCorners outerCorners = RoundCorners::All); + void SetRoundCorners(RoundCorners outerCorners = RoundCorners::All) override; std::string DescribeLog() const override { return (orientation_ == ORIENT_HORIZONTAL ? "LinearLayoutHoriz: " : "LinearLayoutVert: ") + View::DescribeLog(); } diff --git a/UI/DisplayLayoutScreen.cpp b/UI/DisplayLayoutScreen.cpp index 82be2d5738..3824d25c88 100644 --- a/UI/DisplayLayoutScreen.cpp +++ b/UI/DisplayLayoutScreen.cpp @@ -353,7 +353,7 @@ void DisplayLayoutScreen::CreateViews() { mode_->SetSelection(0, false); // The game goes to another output, like a TV, which doesn't use this layout. mode_->SetEnabled(screenManager()->FindOutput(OutputRole::Game) == nullptr); - mode_->ApplyRoundCorners(); + mode_->SetRoundCorners(); bottomControls->Add(mode_); } @@ -428,7 +428,7 @@ void DisplayLayoutScreen::CreateViews() { return g_Config.bStereoRendering && multiViewSupported; }; - leftColumn->ApplyRoundCorners(); + leftColumn->SetRoundCorners(); leftColumn->Add(new ItemHeader(gr->T("Postprocessing shaders"))); diff --git a/UI/GameBrowser.cpp b/UI/GameBrowser.cpp index b40a08612d..e544917f3b 100644 --- a/UI/GameBrowser.cpp +++ b/UI/GameBrowser.cpp @@ -516,7 +516,7 @@ void GameBrowser::Refresh() { layoutChoice->AddChoice(ImageID("I_GRID")); layoutChoice->AddChoice(ImageID("I_LARGE_LIST")); layoutChoice->SetSelection((int)lastViewMode_, false); - layoutChoice->ApplyRoundCorners(); + layoutChoice->SetRoundCorners(); layoutChoice->OnChoice.Handle(this, &GameBrowser::LayoutChange); if (!isRecent) { Choice *rotateChoice = topBar->Add(new Choice(ImageID("I_ROTATE_LEFT"), new LayoutParams(64.0f, 64.0f))); diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 169521831d..4f8247dfbb 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -386,7 +386,7 @@ void MainScreen::CreateMainButtons(UI::LinearLayout *parent, bool portrait) { gold->SetImageScale(0.6f); // for the left icon. gold->SetShine(true); } - parent->ApplyRoundCorners(); + parent->SetRoundCorners(); return; } else { ChoiceGroupList *buttons = parent->Add(new ChoiceGroupList()); diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index 941bd0c755..cffe0042a0 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -602,8 +602,8 @@ void CreditsScreen::CreateDialogViews(UI::ViewGroup *parent) { right->Add(new Spacer(0.0f, new LinearLayoutParams(1.0f))); } - left->ApplyRoundCorners(); - right->ApplyRoundCorners(); + left->SetRoundCorners(); + right->SetRoundCorners(); int rightYOffset = 0; if (!System_GetPropertyBool(SYSPROP_APP_GOLD)) { @@ -641,8 +641,8 @@ void CreditsScreen::CreateDialogViews(UI::ViewGroup *parent) { }); } - left->ApplyRoundCorners(); - right->ApplyRoundCorners(); + left->SetRoundCorners(); + right->SetRoundCorners(); } void CreditsScreen::update() { diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index cce3356ba9..821531d3bc 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -142,6 +142,7 @@ #include "UI/DiscordIntegration.h" #include "UI/EmuScreen.h" #include "UI/FirmwareScreen.h" +#include "UI/DriverManagerScreen.h" #include "UI/GameInfoCache.h" #include "UI/GameSettingsScreen.h" #include "UI/GPUDriverTestScreen.h" @@ -921,6 +922,9 @@ void NativeInit(int argc, const char *argv[], const CommandLineOptions &cmdLineO } else if (equals(cmdLineOptions.startScreen.value(), "credits")) { g_screenManager->switchScreen(new MainScreen()); g_screenManager->push(new CreditsScreen()); + } else if (equals(cmdLineOptions.startScreen.value(), "driver")) { + g_screenManager->switchScreen(new MainScreen()); + g_screenManager->push(new DriverManagerScreen(Path())); } 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/PauseScreen.cpp b/UI/PauseScreen.cpp index 3dd72888a7..ac48ce9c4f 100644 --- a/UI/PauseScreen.cpp +++ b/UI/PauseScreen.cpp @@ -526,7 +526,7 @@ void GamePauseScreen::CreateSavestateControls(UI::LinearLayout *leftColumnItems, if (buttonRow->GetNumSubviews() == 0) { delete buttonRow; } else { - buttonRow->ApplyRoundCorners(); + buttonRow->SetRoundCorners(); *extraRow = buttonRow; } } @@ -666,7 +666,7 @@ void GamePauseScreen::CreateViews() { horiz->Add(new Choice(di->T("More info"), ImageID("I_LINK_OUT_QUESTION"), new LinearLayoutParams(WRAP_CONTENT, WRAP_CONTENT)))->OnClick.Add([](UI::EventParams &e) { System_LaunchUrl(LaunchUrlType::BROWSER_URL, "https://www.ppsspp.org/docs/troubleshooting/save-state-time-warps"); }); - horiz->ApplyRoundCorners(); + horiz->SetRoundCorners(); } LinearLayout *extraRow = nullptr; CreateSavestateControls(saveDataScrollItems, &extraRow); @@ -854,7 +854,7 @@ void GamePauseScreen::CreateViews() { }); } - middleColumn->ApplyRoundCorners(); + middleColumn->SetRoundCorners(); } else { playButton_ = nullptr; } diff --git a/UI/RetroAchievementScreens.cpp b/UI/RetroAchievementScreens.cpp index 2b3f24e9e4..e62d4ce446 100644 --- a/UI/RetroAchievementScreens.cpp +++ b/UI/RetroAchievementScreens.cpp @@ -35,7 +35,7 @@ public: constexpr double MAX_AUDIO_DURATION_SECONDS = 5.0; AudioFileChooser::AudioFileChooser(RequesterToken token, std::string *value, std::string_view title, UI::UISound sound, UI::LayoutParams *layoutParams) : UI::LinearLayout(ORIENT_HORIZONTAL, layoutParams), sound_(sound) { using namespace UI; - SetSpacing(2.0f); + SetSpacing(0.0f); if (!layoutParams) { layoutParams_->width = FILL_PARENT; layoutParams_->height = ITEM_HEIGHT; @@ -455,6 +455,7 @@ void RetroAchievementsSettingsScreen::CreateAccountTab(UI::ViewGroup *viewGroup) System_LaunchUrl(LaunchUrlType::BROWSER_URL, "https://retroachievements.org/createaccount.php"); }); regLink->SetIconRight(ImageID("I_LINK_OUT")); + regLink->SetRoundCorners(); } using namespace UI; diff --git a/UI/SavedataScreen.cpp b/UI/SavedataScreen.cpp index 7e62c2affc..5bbab0cc07 100644 --- a/UI/SavedataScreen.cpp +++ b/UI/SavedataScreen.cpp @@ -193,7 +193,7 @@ void SavedataPopupScreen::CreatePopupContents(UI::ViewGroup *parent) { System_ShowFileInFolder(savePath_); }); } - buttonRow->ApplyRoundCorners(); + buttonRow->SetRoundCorners(); parent->Add(buttonRow); } @@ -624,7 +624,7 @@ void SavedataScreen::CreateSavedataTab(UI::ViewGroup *savedata) { sortOption_ = SavedataSortOption(e.a); dataBrowser_->SetSortOption(sortOption_); }); - sortStrip->ApplyRoundCorners(); + sortStrip->SetRoundCorners(); savedata->Add(sortStrip); dataBrowser_ = savedata->Add(new SavedataBrowser(savedata_dir, new LayoutParams(FILL_PARENT, FILL_PARENT))); @@ -650,7 +650,7 @@ void SavedataScreen::CreateSavestateTab(UI::ViewGroup *savestate) { sortOption_ = SavedataSortOption(e.a); stateBrowser_->SetSortOption(sortOption_); }); - sortStrip->ApplyRoundCorners(); + sortStrip->SetRoundCorners(); savestate->Add(sortStrip); stateBrowser_ = savestate->Add(new SavedataBrowser(savestate_dir)); diff --git a/UI/TouchControlLayoutScreen.cpp b/UI/TouchControlLayoutScreen.cpp index 82a139e440..5630dac646 100644 --- a/UI/TouchControlLayoutScreen.cpp +++ b/UI/TouchControlLayoutScreen.cpp @@ -665,7 +665,7 @@ void TouchControlLayoutScreen::CreateViews() { layoutView_->mode_ = mode; } }); - mode_->ApplyRoundCorners(); + mode_->SetRoundCorners(); leftColumn->Add(mode_); leftColumn->Add(new Choice(co->T("Customize")))->OnClick.Add([this](UI::EventParams &e) { @@ -680,7 +680,7 @@ void TouchControlLayoutScreen::CreateViews() { leftColumn->Add(new Choice(di->T("Reset")))->OnClick.Handle(this, &TouchControlLayoutScreen::OnReset); leftColumn->Add(new Choice(di->T("Back"), ImageID("I_NAVIGATE_BACK")))->OnClick.Handle(this, &UIScreen::OnBack); - leftColumn->ApplyRoundCorners(); + leftColumn->SetRoundCorners(); leftColumnScroll->SetShadows(false);