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>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-24 14:01:58 +02:00
1 parent 13ffe2873f
commit b54056685e
16 files changed
+112 -71

No files matched your search

+12 -5
View File
@@ -231,7 +231,12 @@ void ControlMappingScreen::CreateSettingsViews(UI::ViewGroup *parent) {
using namespace UI;
auto km = GetI18NCategory(I18NCat::KEYMAPPING);
ChoiceGroup *resetChoices = parent->Add(new ChoiceGroup("", new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, Margins(0, 12))));
// Use the whole width of the narrow settings column.
ChoiceGroupList *groups = parent->Add(new ChoiceGroupList());
groups->SetPadding(Margins(0, 12, 0, 0));
groups->SetSpacing(12.0f);
ChoiceGroup *resetChoices = groups->Add(new ChoiceGroup(""));
resetChoices->Add(new Choice(km->T("Clear All")))->OnClick.Add([](UI::EventParams &) {
KeyMap::ClearAllMappings();
@@ -240,7 +245,7 @@ void ControlMappingScreen::CreateSettingsViews(UI::ViewGroup *parent) {
KeyMap::RestoreDefault();
});
ChoiceGroup *moreChoices = parent->Add(new ChoiceGroup("", new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
ChoiceGroup *moreChoices = groups->Add(new ChoiceGroup(""));
std::string sysName = System_GetProperty(SYSPROP_NAME);
// If there's a builtin controller, restore to default should suffice. No need to conf the controller on top.
@@ -533,7 +538,9 @@ void AnalogCalibrationScreen::CreateSettingsViews(UI::ViewGroup *scrollContents)
using namespace UI;
auto co = GetI18NCategory(I18NCat::CONTROLS);
ChoiceGroup *analogSettings = scrollContents->Add(new ChoiceGroup(co->T("Analog Settings")));
ChoiceGroupList *groups = scrollContents->Add(new ChoiceGroupList());
ChoiceGroup *analogSettings = groups->Add(new ChoiceGroup(co->T("Analog Settings")));
// TODO: Would be nicer if these didn't pop up...
analogSettings->Add(new PopupSliderChoiceFloat(&g_Config.fAnalogDeadzone, 0.0f, 0.5f, 0.15f, co->T("Deadzone radius"), 0.01f, screenManager(), "/ 1.0"));
@@ -547,7 +554,7 @@ void AnalogCalibrationScreen::CreateSettingsViews(UI::ViewGroup *scrollContents)
analogSettings->Add(new PopupSliderChoiceFloat(&g_Config.fAnalogAutoRotSpeed, 0.1f, 20.0f, 8.0f, co->T("Auto-rotation speed"), 1.0f, screenManager()));
// Advanced deadzone settings (Steam Input-style).
ChoiceGroup *deadzoneSettings = scrollContents->Add(new ChoiceGroup(co->T("Advanced Deadzone Settings")));
ChoiceGroup *deadzoneSettings = groups->Add(new ChoiceGroup(co->T("Advanced Deadzone Settings")));
static const char *deadzoneShapes[] = { "Circle", "Square", "Cross" };
deadzoneSettings->Add(new PopupMultiChoice(&g_Config.iAnalogDeadzoneShape, co->T("Deadzone shape"), deadzoneShapes, 0, ARRAY_SIZE(deadzoneShapes), I18NCat::CONTROLS, screenManager()));
@@ -560,7 +567,7 @@ void AnalogCalibrationScreen::CreateSettingsViews(UI::ViewGroup *scrollContents)
static const char *responseCurves[] = { "Linear", "Aggressive", "Relaxed", "Wide" };
deadzoneSettings->Add(new PopupMultiChoice(&g_Config.iAnalogResponseCurve, co->T("Response curve"), responseCurves, 0, ARRAY_SIZE(responseCurves), I18NCat::CONTROLS, screenManager()));
scrollContents->Add(new ChoiceGroup(""))->Add(new Choice(co->T("Reset to defaults")))->OnClick.Handle(this, &AnalogCalibrationScreen::OnResetToDefaults);
groups->Add(new ChoiceGroup(""))->Add(new Choice(co->T("Reset to defaults")))->OnClick.Handle(this, &AnalogCalibrationScreen::OnResetToDefaults);
}
void AnalogCalibrationScreen::CreateContentViews(UI::ViewGroup *parent) {