From 19f723d57928442deb4d636cd87be9f30a6528e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 29 Oct 2025 12:03:48 +0100 Subject: [PATCH] Notifications should obey insets --- UI/DeveloperToolsScreen.cpp | 1 + UI/GameSettingsScreen.h | 1 - UI/OnScreenDisplay.cpp | 17 ++++++++--------- UI/OnScreenDisplay.h | 3 +++ UI/SystemInfoScreen.cpp | 2 +- UI/TouchControlLayoutScreen.cpp | 2 +- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/UI/DeveloperToolsScreen.cpp b/UI/DeveloperToolsScreen.cpp index 322b82716a..ce38fbc880 100644 --- a/UI/DeveloperToolsScreen.cpp +++ b/UI/DeveloperToolsScreen.cpp @@ -434,6 +434,7 @@ void DeveloperToolsScreen::CreateUITab(UI::LinearLayout *list) { #ifdef _DEBUG // Untranslated string because this is debug mode only, only for PPSSPP developers. + list->Add(new ItemHeader(ac->T("Assert"))); list->Add(new Choice("Assert"))->OnClick.Add([=](UI::EventParams &) { _dbg_assert_msg_(false, "Test assert message"); }); diff --git a/UI/GameSettingsScreen.h b/UI/GameSettingsScreen.h index cae61a9545..8f41c59ce9 100644 --- a/UI/GameSettingsScreen.h +++ b/UI/GameSettingsScreen.h @@ -183,7 +183,6 @@ private: bool lastResolvedResult_ = false; }; - class GestureMappingScreen : public UITabbedBaseDialogScreen { public: GestureMappingScreen(const Path &gamePath) : UITabbedBaseDialogScreen(gamePath) {} diff --git a/UI/OnScreenDisplay.cpp b/UI/OnScreenDisplay.cpp index e6fbbcfb70..84a47b7e65 100644 --- a/UI/OnScreenDisplay.cpp +++ b/UI/OnScreenDisplay.cpp @@ -408,7 +408,7 @@ void OnScreenMessagesView::Draw(UIContext &dc) { } // First, compute the start position. - float y = padding; + float y = padding + bounds_.y; int horizAdj = 0; int vertAdj = 0; switch ((ScreenEdgePosition)i) { @@ -426,9 +426,9 @@ void OnScreenMessagesView::Draw(UIContext &dc) { if (vertAdj == 0) { // Center vertically - y = (bounds_.h - edges[i].height) * 0.5f; + y = bounds_.centerY() - edges[i].height * 0.5f; } else if (vertAdj == 1) { - y = (bounds_.h - edges[i].height); + y = bounds_.y2() - edges[i].height; } // Then, loop through the entries and those belonging here, get rendered here. @@ -440,14 +440,14 @@ void OnScreenMessagesView::Draw(UIContext &dc) { auto &measuredEntry = measuredEntries[j]; float alpha = measuredEntry.alpha * typeAlpha[(size_t)entry.type]; - Bounds b(padding, y, measuredEntry.w, measuredEntry.h); + Bounds b(bounds_.x + padding, y, measuredEntry.w, measuredEntry.h); if (horizAdj == 0) { // Centered - b.x = (bounds_.w - b.w) * 0.5f; + b.x = bounds_.centerX() - b.w * 0.5f; } else if (horizAdj == 1) { // Right-aligned - b.x = bounds_.w - (b.w + padding); + b.x = bounds_.x2() - (measuredEntry.w + padding); } switch (entry.type) { @@ -470,9 +470,9 @@ void OnScreenMessagesView::Draw(UIContext &dc) { { // Scale down if height doesn't fit. float scale = 1.0f; - if (measuredEntry.h > bounds_.h - y) { + if (measuredEntry.h > bounds_.y2() - y) { // Scale down! - scale = std::max(0.15f, (bounds_.h - y) / measuredEntry.h); + scale = std::max(0.15f, (bounds_.y2() - y) / measuredEntry.h); dc.SetFontScale(scale, scale); b.w *= scale; b.h *= scale; @@ -501,7 +501,6 @@ void OnScreenMessagesView::Draw(UIContext &dc) { } } - y += (measuredEntry.h + 4.0f) * measuredEntry.alpha; } } diff --git a/UI/OnScreenDisplay.h b/UI/OnScreenDisplay.h index f798b029d6..a26d812b44 100644 --- a/UI/OnScreenDisplay.h +++ b/UI/OnScreenDisplay.h @@ -36,6 +36,9 @@ private: class OSDOverlayScreen : public UIScreen { public: + OSDOverlayScreen() { + ignoreInsets_ = false; + } const char *tag() const override { return "OSDOverlayScreen"; } bool UnsyncTouch(const TouchInput &touch) override; diff --git a/UI/SystemInfoScreen.cpp b/UI/SystemInfoScreen.cpp index 09cbc399ad..c8422a5af0 100644 --- a/UI/SystemInfoScreen.cpp +++ b/UI/SystemInfoScreen.cpp @@ -112,7 +112,7 @@ void SystemInfoScreen::CreateDeviceInfoTab(UI::LinearLayout *deviceSpecs) { UI::CollapsibleSection *systemInfo = deviceSpecs->Add(new UI::CollapsibleSection(si->T("System Information"))); - systemInfo->Add(new Choice(si->T("Copy summary to clipboard")))->OnClick.Handle(this, &SystemInfoScreen::CopySummaryToClipboard); + systemInfo->Add(new Choice(si->T("Copy summary to clipboard"), ImageID("I_FILE_COPY")))->OnClick.Handle(this, &SystemInfoScreen::CopySummaryToClipboard); systemInfo->Add(new InfoItem(si->T("System Name"), System_GetProperty(SYSPROP_NAME))); #if PPSSPP_PLATFORM(ANDROID) systemInfo->Add(new InfoItem(si->T("System Version"), StringFromInt(System_GetPropertyInt(SYSPROP_SYSTEMVERSION)))); diff --git a/UI/TouchControlLayoutScreen.cpp b/UI/TouchControlLayoutScreen.cpp index 538d6bac2b..37bfb2d044 100644 --- a/UI/TouchControlLayoutScreen.cpp +++ b/UI/TouchControlLayoutScreen.cpp @@ -664,7 +664,7 @@ void TouchControlLayoutScreen::CreateViews() { leftColumn->Add(gridSize); leftColumn->Add(new Choice(di->T("Reset")))->OnClick.Handle(this, &TouchControlLayoutScreen::OnReset); leftColumn->Add(new Spacer(12.0f)); - leftColumn->Add(new Choice(di->T("Back"), "", false))->OnClick.Handle(this, &UIScreen::OnBack); + leftColumn->Add(new Choice(di->T("Back"), ImageID("I_NAVIGATE_BACK")))->OnClick.Handle(this, &UIScreen::OnBack); leftColumn->Add(new Spacer(0.0f)); LinearLayout* rightColumn = root_->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(1.0f, Margins(0.0f, 12.0f, 12.0f, 12.0f))));