Commit Graph
58 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5.5 b91bd6af86 Settings: Build the settings screen from pages described as data
Each tab is now a SettingsPage: a list of items (headers, settings, buttons,
hints, links to other pages) that a function builds and views are created
from. Settings are added with page->Setting(&g_Config.x), which takes
the label, the kind of view, the range or choices, units, labels for special
values and the default from the config. The pages keep what depends on the
UI (which settings to show and when, enable rules, and behavior that needs the
screen), and reach the screen through the page's SettingsPageHost.

A page can link to other pages, which open on top of it in the same tab,
under a bar showing where you are, like Tools > Developer tools > Graphics,
where the earlier pages can be clicked to go back to them. The bar has back,
search and help buttons, and the back key also goes back a page (or out of a
search) before leaving the screen. Each page remembers its scroll position.
In portrait there's no tab strip: a page links to the tabs, and the bar shows
just the current page's title. Rotating keeps showing the same page. Moving
between pages only focuses an item when navigating with a keyboard or
controller.

The developer tools are now pages linked from the Tools tab, instead of a
screen of their own. The in-game developer menu and
--start-screen=developertools open the settings on that page. The toggles of
live state (the remote debugger and the MIPS tracer) show and change it
through functions, and pretending to be in-game for the notification tests is
a flag on the OSD. The memory map and memstick tests, only reachable from
commented-out code, are removed.

Search lists the matching settings from all tabs and the pages they link to,
grouped by where they are. Each result goes to the setting on its page,
scrolled to and highlighted (outlined, when picked with a mouse or touch), or
for a page, opens it. This replaces the search tab and the old filter that
hid the views that didn't match, and with them ShowSearchControls. Changing
tabs leaves the search.

The pages, the bar and search are in SettingsPagesDialogScreen, between the
tabbed dialog screen and the settings screen, so the other tabbed screens
keep plain tabs.

Other visible changes:
- Reset buttons that went to the wrong value now go to the real default: the
  touch control auto-hide delay (was 20 seconds instead of 8), the mouse
  wheel delay (1 ms, below its own range, instead of 80) and the UI size (0
  instead of -1 on desktop). The alternative speeds get a reset button.
- Units are shown on more sliders (frames, MHz, seconds, Hz), and popups no
  longer spell out what 0 means in the units, since the zero label does.
  Units of up to three characters (%, x, ms, MHz) aren't translated.
- The Android HW scaler hides the scales the display is too small for,
  instead of cutting the list short.
- Choices are translated in the setting's own section.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 15:26:58 +01:00
Henrik Rydgård 695fc865ab Fix some look problems on TabbedDialogScreen 2026-10-24 14:12:53 +02:00
Henrik RydgårdandClaude Opus 5.5 b54056685e UI: Space ChoiceGroups from their container instead of their own margins
ChoiceGroups no longer have hardcoded margins. A new ChoiceGroupList holds them,
with padding and spacing that give the same look as before. Settings tabs, developer
tools, the two-pane settings columns, the pause menu and the rest put their groups in
one, and a few screens adjust its padding and spacing to their layout.

Also add the two groups in the remote disc streaming settings that were created but
never added, and make the settings search look inside groups: it only checked a tab's
direct children, so with ChoiceGroups a filter hid everything.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 14:01:58 +02:00
Henrik RydgårdandClaude Opus 5.5 74bbd4b62e UI: Use ChoiceGroup on more settings-like screens
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 01:52:34 +02:00
Henrik RydgårdandClaude Opus 5.5 0c8c447284 Settings: Fix a blank page when reopening settings on the Search tab
The saved tab was selected before the Search tab was added, so the index
was out of range and no tab was created. Select it after adding Search, and
create the current tab anyway if the saved one no longer exists (Search is
hidden on small screens).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 10:55:30 +02:00
Henrik RydgårdandClaude Opus 5.5 8a4d53996f UI: Fix stale and null search view pointers in tabbed screens
noSearchResults_ and clearSearchChoice_ only exist with the search tab,
which depends on orientation, and were never reset. Rotating with a
filter set wrote into the deleted views, and GAMESETTINGS_SEARCH, which
goes to every screen in the stack, hit null ones on screens without
search controls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 14:32:49 +02:00
Henrik RydgårdandClaude Opus 5.5 27899cc875 UI: Give views in lazily created tabs the views requester token
GetRequesterToken() only returns the views token inside CreateViews(),
but tabbed screens create every tab other than the first on demand, and
the persist restore after CreateViews() can create one too. So text
inputs and file choosers there (Networking tab nickname, search filter,
RemoteISO and achievement settings) registered their [this] callbacks
under the screen token, which a recreate doesn't forget. Open the native
input box, rotate, press OK, and the callback wrote through the deleted
view.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 14:32:49 +02:00
Henrik Rydgård 7219cd2f5a Split off ScreenManager from Screen.cpp 2026-08-07 14:30:36 +02:00
Henrik Rydgård d78d51851c More tab code cleanup 2026-05-13 17:25:52 +02:00
Henrik Rydgård 59f545e804 Fix issue with the current tab not being saved through screen recreation 2026-05-12 10:13:00 +02:00
Henrik Rydgård 49d3d3dc37 Settings and dev settings: Preserve the current tab. Minor UI tweaks. 2026-04-06 12:09:40 -06:00
Henrik Rydgård 03f7d13288 Remove unnecessary AnchorLayout from TabbedDialogScreen 2026-03-09 15:37:40 +01:00
Henrik Rydgård 4b3af8cb54 Fix some minor UI issues with title bars 2026-02-17 22:36:43 +01:00
Henrik Rydgård 1d436bae53 Fix problem with settings filter/search functionality
Fixes #21143 (which also affected Mac and Linux)
2026-01-30 14:20:43 +01:00
Henrik Rydgård 481d0fd18c Switch TouchInputFlags to enum class, fix some minor UI issues
Scroll views now only wheel-scroll if the mouse is hovering over them.
2025-12-19 11:38:56 +01:00
Henrik Rydgård 22b3ad2372 Get rid of the SettingInfoMessage popups 2025-11-23 13:56:34 +01:00
Henrik Rydgård 0d309a5db1 Add titles on developer tools tabs 2025-11-22 10:37:43 +01:00
Henrik Rydgård 8b52cf67af Add a way to put the "ExtraButtons" in a popup menu, use on control mapping screen 2025-11-15 20:44:14 +01:00
Henrik Rydgård 9de8e75709 AnchorLayout: Allow centering separately for horizontal and vertical 2025-11-10 12:10:08 +01:00
Henrik Rydgård 48ba3d99d3 GameSettingsScreen: Add tab icons. In portrait mode, use only icons on the tabs. 2025-11-05 15:29:34 +01:00
Henrik Rydgård 75020e2ed7 Add ability to put icons on tabs 2025-11-05 14:42:49 +01:00
Henrik Rydgård 67010ff2af Split the display layout config between landscape and portrait orientations 2025-11-05 12:49:51 +01:00
Henrik Rydgård 2b9f2672bb UI screens header cleanup 2025-10-29 00:15:41 +01:00
Henrik Rydgård 7ffd72b32e Rename some screen classes 2025-10-29 00:02:43 +01:00
Henrik Rydgård acf273a55a Rename "vertical layout" to "portrait layout", to avoid confusion 2025-10-23 16:11:54 +02:00
Henrik Rydgård 28b9bc2fb3 Make more dev screens usable in portrait by converting them to TabbedDialogScreen 2025-10-23 15:33:09 +02:00
Henrik Rydgård 1514df8e3a Add a much more usable back button to Settings screen in portrait mode 2025-10-23 13:48:41 +02:00
Henrik Rydgård 7b743071d2 Prepare for adding more sensible back buttons to TabbedDialogScreen portrait mode 2025-10-23 12:46:07 +02:00
Henrik Rydgård b45d07d6cb Break out TabHolder from Common/UI/ViewGroup.cpp. A few new atlas images 2025-10-23 11:19:20 +02:00
Henrik Rydgård 58456ae950 Remove the UI::EventReturn return values. Makes editing the UI nicer. 2025-09-15 11:09:00 -06:00
Nab 5200ace606 GUI margin and Back button adjustments 2025-09-07 20:10:50 +02:00
Henrik Rydgård 70f1edb28f Misc sanity checks 2025-06-14 08:45:02 +02:00
Henrik Rydgård 27a38042df Setting search: Don't display "Clear filter" button initially (when there's no filter) 2025-04-30 11:50:47 +02:00
Henrik Rydgård fbb5d649e4 Fix hang bug when searching settings in the Developer Tools screen 2025-04-30 11:50:47 +02:00
Henrik Rydgård 91bf4d5b5c Correct some log categories, add UI category, some warning fixes 2025-04-09 13:45:21 +02:00
Henrik Rydgård 4df25788fd UI: Fix focus issue, thanks NABN00B.
Fixes #20217
2025-04-07 13:39:47 +02:00
Henrik Rydgård ae7586e313 Fix regression in save data manager search 2025-03-27 14:46:08 +01:00
Henrik Rydgård c418513fa5 Fix bad check, add some comments
And remove unneded initial text.
2025-03-25 22:01:33 +01:00
Henrik Rydgård ad260fa6a8 Implement lazy loading of tabs 2025-03-23 22:48:57 +01:00
Henrik Rydgård 6efb758893 CHange the TabbedDialog create-tab API to allow for future lazy-loading 2025-03-23 22:48:57 +01:00
Henrik Rydgård 76ce11ad2c Remove a vector while keeping settings search working. 2025-03-23 22:48:57 +01:00
Henrik Rydgård 4d43ee5f59 Use the banner support for the search filter notice. 2025-03-23 22:48:57 +01:00
Henrik Rydgård 0ba92081ed Add banner support to tab holders 2025-03-23 22:48:51 +01:00
Henrik Rydgård 249281366e Use the new sceAtrac implementation by default
Inverts/renames the setting to allow going back to the old sceAtrac
implementation, to work around any compatibility issue.

Note that we can never delete the old implementation, old savestates
will still use it - can't convert an existing session.
2025-03-20 23:10:21 +01:00
Henrik Rydgård 88b4991753 UI fixes: Rework savedata manager a bit, default keyboard focus to Cancel in confirmation dialogs (#19771)
* Savedata manager screen: Use TabbedUIDialogScreenWithGameBackground

This fixes some minor UI issues on this screen.

* PromptScreen (used for "Are you sure?"): Default keyboard focus to Cancel

Fixes #19770
2024-12-28 10:36:05 +01:00
Henrik Rydgård c5791764d8 Make the i18n T function use std::string_view
Buildfixes, crashfixes

One more

Android buildfix

Buildfix Qt
2024-02-12 18:44:39 +01:00
Henrik Rydgård 0e03b66a95 Make vertical tabs scrollable 2024-01-19 14:56:29 +01:00
Henrik Rydgård 1304d04161 Fix a particular type of race condition in file dialog requests
It seems to be possible for a user to back out of a screen before
receiving the "dialog completed" callback on Android, in which case
things pointed to by the callback might be gone.

In this case, it's better to simply not call the callback, rather than
crashing.

This is accomplished by assigning "Tokens" to screens that cause
requests, and in ~Screen, invalidate any pending requests belonging to
that token.
2024-01-18 12:25:55 +01:00
Herman Semenov 95f535dab0 [UI/Windows] Object out of scope optimization for better codegeneration (lower level scope) 2023-12-20 12:35:02 +03:00
Henrik Rydgård 19e4de5088 Change global UI messages to use an enum instead of strings.
Makes it easier to add new ones and delete outdated ones without missing
any uses.
2023-09-30 11:37:02 +02:00