From 6cc945e57ad8326bdd56aae591ca3a4c5c53ea07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 23 Nov 2025 01:01:52 +0100 Subject: [PATCH] Rework the reporting screen a bit --- UI/ControlMappingScreen.cpp | 2 +- UI/GameScreen.cpp | 2 +- UI/GameSettingsScreen.cpp | 4 +- UI/ReportScreen.cpp | 167 ++++++++++++++++++---------------- UI/ReportScreen.h | 21 +++-- UI/SimpleDialogScreen.cpp | 12 ++- UI/SimpleDialogScreen.h | 1 + UI/TiltAnalogSettingsScreen.h | 2 +- assets/ui_images/images.svg | 18 ++-- 9 files changed, 122 insertions(+), 107 deletions(-) diff --git a/UI/ControlMappingScreen.cpp b/UI/ControlMappingScreen.cpp index eac5ed1143..856ef8bc71 100644 --- a/UI/ControlMappingScreen.cpp +++ b/UI/ControlMappingScreen.cpp @@ -480,7 +480,7 @@ void KeyMappingNewMouseKeyDialog::axis(const AxisInput &axis) { } } -AnalogCalibrationScreen::AnalogCalibrationScreen(const Path &gamePath) : UITwoPaneBaseDialogScreen(gamePath, TwoPaneFlags::Default) { +AnalogCalibrationScreen::AnalogCalibrationScreen(const Path &gamePath) : UITwoPaneBaseDialogScreen(gamePath, TwoPaneFlags::SettingsCanScroll) { mapper_.SetCallbacks( [](int vkey, bool down) {}, [](int vkey, float analogValue) {}, diff --git a/UI/GameScreen.cpp b/UI/GameScreen.cpp index a8ea552791..a092bcb7ac 100644 --- a/UI/GameScreen.cpp +++ b/UI/GameScreen.cpp @@ -56,7 +56,7 @@ constexpr GameInfoFlags g_desiredFlags = GameInfoFlags::PARAM_SFO | GameInfoFlags::ICON | GameInfoFlags::PIC0 | GameInfoFlags::PIC1 | GameInfoFlags::UNCOMPRESSED_SIZE | GameInfoFlags::SIZE; -GameScreen::GameScreen(const Path &gamePath, bool inGame) : UITwoPaneBaseDialogScreen(gamePath, TwoPaneFlags::SettingsToTheRight | TwoPaneFlags::SettingsInContextMenu), inGame_(inGame) { +GameScreen::GameScreen(const Path &gamePath, bool inGame) : UITwoPaneBaseDialogScreen(gamePath, TwoPaneFlags::SettingsToTheRight | TwoPaneFlags::SettingsInContextMenu | TwoPaneFlags::SettingsCanScroll), inGame_(inGame) { g_BackgroundAudio.SetGame(gamePath); System_PostUIMessage(UIMessage::GAME_SELECTED, gamePath.ToString()); diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 507854a0b6..d18db6aeb8 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -953,7 +953,7 @@ public: MacAddressChooser(RequesterToken token, Path gamePath, std::string *value, std::string_view title, ScreenManager *screenManager, UI::LayoutParams *layoutParams = nullptr); }; -MacAddressChooser::MacAddressChooser(RequesterToken token, Path gamePath_, std::string *value, std::string_view title, ScreenManager *screenManager, UI::LayoutParams *layoutParams) : UI::LinearLayout(ORIENT_HORIZONTAL, layoutParams) { +MacAddressChooser::MacAddressChooser(RequesterToken token, Path gamePath, std::string *value, std::string_view title, ScreenManager *screenManager, UI::LayoutParams *layoutParams) : UI::LinearLayout(ORIENT_HORIZONTAL, layoutParams) { using namespace UI; SetSpacing(5.0f); if (!layoutParams) { @@ -979,7 +979,7 @@ MacAddressChooser::MacAddressChooser(RequesterToken token, Path gamePath_, std:: std::string combined = g_Config.sMACAddress + "\n\n" + std::string(confirmMessage) + "\n\n" + std::string(warningMessage); auto confirmScreen = new PromptScreen( - gamePath_, + gamePath, combined, di->T("Yes"), di->T("No"), [&](bool success) { if (success) { diff --git a/UI/ReportScreen.cpp b/UI/ReportScreen.cpp index e967a5d3de..52c7b9f0d3 100644 --- a/UI/ReportScreen.cpp +++ b/UI/ReportScreen.cpp @@ -37,11 +37,9 @@ #include "UI/PauseScreen.h" #include "UI/ReportScreen.h" -using namespace UI; - -class RatingChoice : public LinearLayout { +class RatingChoice : public UI::LinearLayout { public: - RatingChoice(std::string_view captionKey, int *value, LayoutParams *layoutParams = 0); + RatingChoice(std::string_view captionKey, int *value, UI::LayoutParams *layoutParams = 0); RatingChoice *SetEnabledPtrs(bool *enabled); @@ -55,25 +53,25 @@ protected: return 3; } void AddChoice(int i, std::string_view title); - StickyChoice *GetChoice(int i) { - return static_cast(group_->GetViewByIndex(i)); + UI::StickyChoice *GetChoice(int i) { + return static_cast(group_->GetViewByIndex(i)); } LinearLayout *group_; private: - void OnChoiceClick(EventParams &e); + void OnChoiceClick(UI::EventParams &e); int *value_; }; -RatingChoice::RatingChoice(std::string_view captionKey, int *value, LayoutParams *layoutParams) +RatingChoice::RatingChoice(std::string_view captionKey, int *value, UI::LayoutParams *layoutParams) : LinearLayout(ORIENT_VERTICAL, layoutParams), value_(value) { SetSpacing(0.0f); auto rp = GetI18NCategory(I18NCat::REPORTING); group_ = new LinearLayout(ORIENT_HORIZONTAL); - Add(new TextView(rp->T(captionKey), FLAG_WRAP_TEXT, false))->SetShadow(true); + Add(new UI::TextView(rp->T(captionKey), FLAG_WRAP_TEXT, false))->SetShadow(true); Add(group_); group_->SetSpacing(0.0f); @@ -84,7 +82,7 @@ void RatingChoice::Update() { LinearLayout::Update(); for (int i = 0; i < TotalChoices(); i++) { - StickyChoice *chosen = GetChoice(i); + UI::StickyChoice *chosen = GetChoice(i); bool down = chosen->IsDown(); if (down && *value_ != i) { chosen->Release(); @@ -110,15 +108,15 @@ void RatingChoice::SetupChoices() { } void RatingChoice::AddChoice(int i, std::string_view title) { - auto c = group_->Add(new StickyChoice(title, "")); + auto c = group_->Add(new UI::StickyChoice(title, "")); c->OnClick.Handle(this, &RatingChoice::OnChoiceClick); } -void RatingChoice::OnChoiceClick(EventParams &e) { +void RatingChoice::OnChoiceClick(UI::EventParams &e) { // Unstick the other choices that weren't clicked. int total = TotalChoices(); for (int i = 0; i < total; i++) { - StickyChoice *v = GetChoice(i); + UI::StickyChoice *v = GetChoice(i); if (v != e.v) { v->Release(); } else { @@ -126,7 +124,7 @@ void RatingChoice::OnChoiceClick(EventParams &e) { } } - EventParams e2{}; + UI::EventParams e2{}; e2.v = e.v; e2.a = *value_; // Dispatch immediately (we're already on the UI thread as we're in an event handler). @@ -135,7 +133,7 @@ void RatingChoice::OnChoiceClick(EventParams &e) { class CompatRatingChoice : public RatingChoice { public: - CompatRatingChoice(const char *captionKey, int *value, LayoutParams *layoutParams = 0); + CompatRatingChoice(const char *captionKey, int *value, UI::LayoutParams *layoutParams = 0); protected: void SetupChoices() override; @@ -144,7 +142,7 @@ protected: } }; -CompatRatingChoice::CompatRatingChoice(const char *captionKey, int *value, LayoutParams *layoutParams) +CompatRatingChoice::CompatRatingChoice(const char *captionKey, int *value, UI::LayoutParams *layoutParams) : RatingChoice(captionKey, value, layoutParams) { CompatRatingChoice::SetupChoices(); } @@ -160,7 +158,7 @@ void CompatRatingChoice::SetupChoices() { } ReportScreen::ReportScreen(const Path &gamePath) - : UIDialogScreen(), gamePath_(gamePath) { + : UITwoPaneBaseDialogScreen(gamePath, TwoPaneFlags::SettingsToTheRight) { enableReporting_ = Reporting::IsEnabled(); ratingEnabled_ = enableReporting_; // Start computing a CRC immediately, we'll need it on submit. @@ -196,20 +194,28 @@ ScreenRenderFlags ReportScreen::render(ScreenRenderMode mode) { // We take the screenshot first, then we start rendering. // We are the only screen visible so this avoid starting and then trying to resume a backbuffer render pass. - const ScreenRenderFlags flags = UIScreen::render(mode); - return flags; + return UITwoPaneBaseDialogScreen::render(mode); +} + +// For the screenshotting functionality to work. +ScreenRenderRole ReportScreen::renderRole(bool isTop) const { + // if (tookScreenshot_) { + // return ScreenRenderRole::NONE; + // } + return ScreenRenderRole::MUST_BE_FIRST | ScreenRenderRole::CAN_BE_BACKGROUND; } void ReportScreen::update() { if (screenshot_) { if (includeScreenshot_) { - screenshot_->SetVisibility(V_VISIBLE); + screenshot_->SetVisibility(UI::V_VISIBLE); } else { - screenshot_->SetVisibility(V_GONE); + screenshot_->SetVisibility(UI::V_GONE); } } UIDialogScreen::update(); UpdateCRCInfo(); + UpdateSubmit(); } void ReportScreen::resized() { @@ -217,7 +223,7 @@ void ReportScreen::resized() { RecreateViews(); } -void ReportScreen::HandleChoice(EventParams &e) { +void ReportScreen::HandleChoice(UI::EventParams &e) { if (overall_ == ReportingOverallScore::NONE) { graphics_ = 0; speed_ = 0; @@ -244,7 +250,7 @@ void ReportScreen::HandleChoice(EventParams &e) { UpdateOverallDescription(); } -void ReportScreen::HandleReportingChange(EventParams &e) { +void ReportScreen::HandleReportingChange(UI::EventParams &e) { if (overall_ == ReportingOverallScore::NONE) { ratingEnabled_ = false; } else { @@ -256,19 +262,35 @@ void ReportScreen::HandleReportingChange(EventParams &e) { UpdateSubmit(); } -void ReportScreen::CreateViews() { +void ReportScreen::CreateSettingsViews(UI::ViewGroup *rightColumnItems) { + using namespace UI; + auto rp = GetI18NCategory(I18NCat::REPORTING); auto di = GetI18NCategory(I18NCat::DIALOG); - Margins actionMenuMargins(0, 20, 15, 0); - Margins contentMargins(0, 20, 5, 5); - float leftColumnWidth = g_display.dp_xres - actionMenuMargins.horiz() - contentMargins.horiz() - 300.0f; - ViewGroup *leftColumn = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(WRAP_CONTENT, FILL_PARENT, 0.4f, contentMargins)); - LinearLayout *leftColumnItems = new LinearLayout(ORIENT_VERTICAL, new LayoutParams(WRAP_CONTENT, FILL_PARENT)); - ViewGroup *rightColumn = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(300, FILL_PARENT, actionMenuMargins)); - LinearLayout *rightColumnItems = new LinearLayout(ORIENT_VERTICAL); + rightColumnItems->Add(new Choice(rp->T("Open Browser"), ImageID("I_LINK_OUT")))->OnClick.Handle(this, &ReportScreen::HandleBrowser); + submit_ = new Choice(rp->T("Submit Feedback"), ImageID("I_CHECKMARK")); + rightColumnItems->Add(submit_)->OnClick.Handle(this, &ReportScreen::HandleSubmit); + submit_->SetEnabled(false); // Waiting for CRC - leftColumnItems->Add(new TextView(rp->T("FeedbackDesc", "How's the emulation? Let us and the community know!"), FLAG_WRAP_TEXT, false, new LinearLayoutParams(Margins(12, 5, 0, 5))))->SetShadow(true); + UpdateSubmit(); +} + +void ReportScreen::CreateContentViews(UI::ViewGroup *parent) { + using namespace UI; + + UI::ScrollView *scroll = new UI::ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(1.0f)); + UI::LinearLayout *leftColumnItems = new UI::LinearLayout(ORIENT_VERTICAL, new UI::LinearLayoutParams(WRAP_CONTENT, WRAP_CONTENT)); + + scroll->Add(leftColumnItems); + parent->Add(scroll); + + auto rp = GetI18NCategory(I18NCat::REPORTING); + auto di = GetI18NCategory(I18NCat::DIALOG); + + bool portrait = GetDeviceOrientation() == DeviceOrientation::Portrait; + + leftColumnItems->Add(new TextView(rp->T("FeedbackDesc", "How's the emulation? Let us and the community know!"), FLAG_WRAP_TEXT, false, new LinearLayoutParams(Margins(12, 5, 0, 5))))->SetShadow(true); if (!Reporting::IsEnabled()) { auto sy = GetI18NCategory(I18NCat::SYSTEM); reportingNotice_ = leftColumnItems->Add(new TextView(rp->T("FeedbackDisabled", "Compatibility server reports must be enabled."), FLAG_WRAP_TEXT, false, new LinearLayoutParams(Margins(12, 5, 0, 5)))); @@ -309,36 +331,29 @@ void ReportScreen::CreateViews() { overallDescription_ = leftColumnItems->Add(new TextView("", FLAG_WRAP_TEXT, false, new LinearLayoutParams(Margins(10, 0)))); overallDescription_->SetShadow(true); - Orientation ratingsOrient = leftColumnWidth >= 750.0f ? ORIENT_HORIZONTAL : ORIENT_VERTICAL; - LinearLayout *ratingsHolder = new LinearLayoutList(ratingsOrient, new LinearLayoutParams(WRAP_CONTENT, WRAP_CONTENT)); + LinearLayout *ratingsHolder = new LinearLayoutList(ORIENT_VERTICAL, new LinearLayoutParams(WRAP_CONTENT, WRAP_CONTENT)); leftColumnItems->Add(ratingsHolder); ratingsHolder->Add(new RatingChoice("Graphics", &graphics_))->SetEnabledPtrs(&ratingEnabled_)->OnChoice.Handle(this, &ReportScreen::HandleChoice); ratingsHolder->Add(new RatingChoice("Speed", &speed_))->SetEnabledPtrs(&ratingEnabled_)->OnChoice.Handle(this, &ReportScreen::HandleChoice); ratingsHolder->Add(new RatingChoice("Gameplay", &gameplay_))->SetEnabledPtrs(&ratingEnabled_)->OnChoice.Handle(this, &ReportScreen::HandleChoice); - rightColumnItems->SetSpacing(0.0f); - rightColumnItems->Add(new Choice(rp->T("Open Browser")))->OnClick.Handle(this, &ReportScreen::HandleBrowser); - submit_ = new Choice(rp->T("Submit Feedback")); - rightColumnItems->Add(submit_)->OnClick.Handle(this, &ReportScreen::HandleSubmit); - submit_->SetEnabled(false); // Waiting for CRC - UpdateSubmit(); - UpdateOverallDescription(); - - rightColumnItems->Add(new Spacer(25.0)); - rightColumnItems->Add(new Choice(di->T("Back"), ImageID("I_NAVIGATE_BACK"), new AnchorLayoutParams(150, WRAP_CONTENT, 10, NONE, NONE, 10)))->OnClick.Handle(this, &UIScreen::OnBack); - - root_ = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT, 1.0f)); - root_->Add(leftColumn); - root_->Add(rightColumn); - - leftColumn->Add(leftColumnItems); - rightColumn->Add(rightColumnItems); - UpdateCRCInfo(); + UpdateOverallDescription(); } void ReportScreen::UpdateSubmit() { - submit_->SetEnabled(enableReporting_ && overall_ != ReportingOverallScore::INVALID && graphics_ >= 0 && speed_ >= 0 && gameplay_ >= 0); + submit_->SetEnabled(Reporting::HasCRC(gamePath_) && enableReporting_ && overall_ != ReportingOverallScore::INVALID && graphics_ >= 0 && speed_ >= 0 && gameplay_ >= 0); +} + +std::string_view ReportScreen::GetTitle() const { + if (titleCache_.empty()) { + titleCache_ = g_paramSFO.GetValueString("TITLE"); + if (titleCache_.empty()) { + auto rp = GetI18NCategory(I18NCat::REPORTING); + titleCache_ = rp->T("Submit Feedback"); + } + } + return titleCache_; } void ReportScreen::UpdateCRCInfo() { @@ -348,14 +363,13 @@ void ReportScreen::UpdateCRCInfo() { if (Reporting::HasCRC(gamePath_)) { std::string crc = StringFromFormat("%08X", Reporting::RetrieveCRC(gamePath_)); updated = ApplySafeSubstitutions(rp->T("FeedbackCRCValue", "Disc CRC: %1"), crc); - submit_->SetEnabled(true); } else { updated = rp->T("FeedbackCRCCalculating", "Disc CRC: Calculating..."); } if (!updated.empty()) { crcInfo_->SetText(updated); - crcInfo_->SetVisibility(V_VISIBLE); + crcInfo_->SetVisibility(UI::V_VISIBLE); } } @@ -376,7 +390,7 @@ void ReportScreen::UpdateOverallDescription() { overallDescription_->SetTextColor(c); } -void ReportScreen::HandleSubmit(EventParams &e) { +void ReportScreen::HandleSubmit(UI::EventParams &e) { const char *compat; switch (overall_) { case ReportingOverallScore::PERFECT: compat = "perfect"; break; @@ -398,48 +412,39 @@ void ReportScreen::HandleSubmit(EventParams &e) { screenManager()->push(new ReportFinishScreen(gamePath_, overall_)); } -void ReportScreen::HandleBrowser(EventParams &e) { +void ReportScreen::HandleBrowser(UI::EventParams &e) { const std::string url = "https://" + Reporting::ServerHost() + "/"; System_LaunchUrl(LaunchUrlType::BROWSER_URL, url.c_str()); } ReportFinishScreen::ReportFinishScreen(const Path &gamePath, ReportingOverallScore score) - : UIDialogScreen(), gamePath_(gamePath), score_(score) { + : UISimpleBaseDialogScreen(), gamePath_(gamePath), score_(score) { } -void ReportFinishScreen::CreateViews() { +std::string_view ReportFinishScreen::GetTitle() const { + auto rp = GetI18NCategory(I18NCat::REPORTING); + return rp->T("Submit Feedback"); +} + +void ReportFinishScreen::CreateDialogViews(UI::ViewGroup *parent) { auto rp = GetI18NCategory(I18NCat::REPORTING); auto di = GetI18NCategory(I18NCat::DIALOG); - Margins actionMenuMargins(0, 20, 15, 0); - Margins contentMargins(0, 20, 5, 5); - ViewGroup *leftColumn = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(WRAP_CONTENT, FILL_PARENT, 0.4f, contentMargins)); - LinearLayout *leftColumnItems = new LinearLayout(ORIENT_VERTICAL, new LayoutParams(WRAP_CONTENT, FILL_PARENT)); - ViewGroup *rightColumn = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(300, FILL_PARENT, actionMenuMargins)); - LinearLayout *rightColumnItems = new LinearLayout(ORIENT_VERTICAL); + using namespace UI; - leftColumnItems->Add(new TextView(rp->T("FeedbackThanks", "Thanks for your feedback."), FLAG_WRAP_TEXT, false, new LinearLayoutParams(Margins(12, 5, 0, 5))))->SetShadow(true); + parent->Add(new TextView(rp->T("FeedbackThanks", "Thanks for your feedback."), FLAG_WRAP_TEXT, false, new LinearLayoutParams(Margins(12, 5, 0, 5))))->SetShadow(true); if (score_ == ReportingOverallScore::PERFECT || score_ == ReportingOverallScore::PLAYABLE) { - resultNotice_ = leftColumnItems->Add(new TextView(rp->T("FeedbackDelayInfo", "Your data is being submitted in the background."), FLAG_WRAP_TEXT, false, new LinearLayoutParams(Margins(12, 5, 0, 5)))); + resultNotice_ = parent->Add(new TextView(rp->T("FeedbackDelayInfo", "Your data is being submitted in the background."), FLAG_WRAP_TEXT, false, new LinearLayoutParams(Margins(12, 5, 0, 5)))); } else { - resultNotice_ = leftColumnItems->Add(new TextView(rp->T("SuggestionsWaiting", "Submitting and checking other user feedback.."), FLAG_WRAP_TEXT, false, new LinearLayoutParams(Margins(12, 5, 0, 5)))); + resultNotice_ = parent->Add(new TextView(rp->T("SuggestionsWaiting", "Submitting and checking other user feedback.."), FLAG_WRAP_TEXT, false, new LinearLayoutParams(Margins(12, 5, 0, 5)))); } resultNotice_->SetShadow(true); resultItems_ = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, Margins(12, 5, 0, 5))); - leftColumnItems->Add(resultItems_); + parent->Add(resultItems_); - rightColumnItems->SetSpacing(0.0f); - rightColumnItems->Add(new Choice(rp->T("View Feedback")))->OnClick.Handle(this, &ReportFinishScreen::HandleViewFeedback); + parent->Add(new Spacer(20.0f)); - rightColumnItems->Add(new Spacer(25.0)); - rightColumnItems->Add(new Choice(di->T("Back"), ImageID("I_NAVIGATE_BACK"), new AnchorLayoutParams(150, WRAP_CONTENT, 10, NONE, NONE, 10)))->OnClick.Handle(this, &UIScreen::OnBack); - - root_ = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT, 1.0f)); - root_->Add(leftColumn); - root_->Add(rightColumn); - - leftColumn->Add(leftColumnItems); - rightColumn->Add(rightColumnItems); + parent->Add(new Choice(rp->T("View Feedback"), ImageID("I_LINK_OUT")))->OnClick.Handle(this, &ReportFinishScreen::HandleViewFeedback); } void ReportFinishScreen::update() { @@ -469,6 +474,8 @@ void ReportFinishScreen::update() { } void ReportFinishScreen::ShowSuggestions() { + using namespace UI; + auto rp = GetI18NCategory(I18NCat::REPORTING); auto suggestions = Reporting::CompatibilitySuggestions(); diff --git a/UI/ReportScreen.h b/UI/ReportScreen.h index 786b44324c..4e0d359d00 100644 --- a/UI/ReportScreen.h +++ b/UI/ReportScreen.h @@ -21,8 +21,9 @@ #include "Common/UI/UIScreen.h" #include "Common/UI/ViewGroup.h" -#include "UI/BaseScreens.h" #include "Common/File/Path.h" +#include "UI/BaseScreens.h" +#include "UI/SimpleDialogScreen.h" enum class ReportingOverallScore : int { PERFECT = 0, @@ -33,23 +34,25 @@ enum class ReportingOverallScore : int { INVALID = -1, }; -class ReportScreen : public UIDialogScreen { +class ReportScreen : public UITwoPaneBaseDialogScreen { public: ReportScreen(const Path &gamePath); const char *tag() const override { return "Report"; } // For the screenshotting functionality to work. - ScreenRenderRole renderRole(bool isTop) const override { return ScreenRenderRole::MUST_BE_FIRST | ScreenRenderRole::CAN_BE_BACKGROUND; } + ScreenRenderRole renderRole(bool isTop) const override; protected: ScreenRenderFlags render(ScreenRenderMode mode) override; void update() override; void resized() override; - void CreateViews() override; + void CreateSettingsViews(UI::ViewGroup *parent) override; + void CreateContentViews(UI::ViewGroup *parent) override; void UpdateSubmit(); void UpdateCRCInfo(); void UpdateOverallDescription(); + std::string_view GetTitle() const override; void HandleChoice(UI::EventParams &e); void HandleSubmit(UI::EventParams &e); @@ -61,7 +64,6 @@ protected: UI::TextView *reportingNotice_ = nullptr; UI::TextView *overallDescription_ = nullptr; UI::TextView *crcInfo_ = nullptr; - Path gamePath_; Path screenshotFilename_; ReportingOverallScore overall_ = ReportingOverallScore::INVALID; @@ -72,17 +74,20 @@ protected: bool ratingEnabled_; bool tookScreenshot_ = false; bool includeScreenshot_ = true; + mutable std::string titleCache_; }; -class ReportFinishScreen : public UIDialogScreen { +class ReportFinishScreen : public UISimpleBaseDialogScreen { public: ReportFinishScreen(const Path &gamePath, ReportingOverallScore score); const char *tag() const override { return "ReportFinish"; } protected: + std::string_view GetTitle() const override; + void update() override; - void CreateViews() override; + void CreateDialogViews(UI::ViewGroup *parent) override; void ShowSuggestions(); void HandleViewFeedback(UI::EventParams &e); @@ -90,6 +95,6 @@ protected: UI::TextView *resultNotice_ = nullptr; UI::LinearLayout *resultItems_ = nullptr; Path gamePath_; - ReportingOverallScore score_; + ReportingOverallScore score_{}; bool setStatus_ = false; }; diff --git a/UI/SimpleDialogScreen.cpp b/UI/SimpleDialogScreen.cpp index a47b9b90ba..7cf9046ec1 100644 --- a/UI/SimpleDialogScreen.cpp +++ b/UI/SimpleDialogScreen.cpp @@ -54,11 +54,15 @@ void UITwoPaneBaseDialogScreen::CreateViews() { }, nullptr)); }); } else { - ScrollView *settingsScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT, 1.0f, Margins(8))); - LinearLayout *settingsPane = new LinearLayout(ORIENT_VERTICAL); - settingsScroll->Add(settingsPane); + LinearLayout *settingsPane = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)); + if (flags_ & TwoPaneFlags::SettingsCanScroll) { + ScrollView *settingsScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT, 1.0f, Margins(8))); + settingsScroll->Add(settingsPane); + root->Add(settingsScroll); + } else { + root->Add(settingsPane); + } CreateSettingsViews(settingsPane); - root->Add(settingsScroll); } root_ = root; } else { diff --git a/UI/SimpleDialogScreen.h b/UI/SimpleDialogScreen.h index a7942efaf4..6af15a4dbc 100644 --- a/UI/SimpleDialogScreen.h +++ b/UI/SimpleDialogScreen.h @@ -28,6 +28,7 @@ enum class TwoPaneFlags { Default = 0, SettingsToTheRight = 1, SettingsInContextMenu = 2, + SettingsCanScroll = 4, }; ENUM_CLASS_BITOPS(TwoPaneFlags); diff --git a/UI/TiltAnalogSettingsScreen.h b/UI/TiltAnalogSettingsScreen.h index a6714bf27a..2f67a1da72 100644 --- a/UI/TiltAnalogSettingsScreen.h +++ b/UI/TiltAnalogSettingsScreen.h @@ -26,7 +26,7 @@ class GamepadView; class TiltAnalogSettingsScreen : public UITwoPaneBaseDialogScreen { public: - TiltAnalogSettingsScreen(const Path &gamePath) : UITwoPaneBaseDialogScreen(gamePath, TwoPaneFlags::Default) {} + TiltAnalogSettingsScreen(const Path &gamePath) : UITwoPaneBaseDialogScreen(gamePath, TwoPaneFlags::SettingsCanScroll) {} void CreateSettingsViews(UI::ViewGroup *parent) override; void CreateContentViews(UI::ViewGroup*parent) override; diff --git a/assets/ui_images/images.svg b/assets/ui_images/images.svg index d6dd7b53f8..213593f071 100644 --- a/assets/ui_images/images.svg +++ b/assets/ui_images/images.svg @@ -24,15 +24,15 @@ inkscape:pagecheckerboard="true" inkscape:deskcolor="#d1d1d1" inkscape:document-units="px" - inkscape:zoom="5.6568546" - inkscape:cx="19.091882" - inkscape:cy="534.4843" + inkscape:zoom="1.0000001" + inkscape:cx="-560.99996" + inkscape:cy="-89.499994" inkscape:window-width="3840" inkscape:window-height="2071" inkscape:window-x="-9" inkscape:window-y="-9" inkscape:window-maximized="1" - inkscape:current-layer="g115" + inkscape:current-layer="layer1" showgrid="false" />