A lot more round corner fixes and layout fixes.

This commit is contained in:
Henrik Rydgård committed 2026-10-25 10:28:40 +01:00
1 parent daadd1a15c
commit 965b07c527
20 files changed
+96 -69

No files matched your search

+15 -13
View File
@@ -237,8 +237,7 @@ void ControlMappingScreen::CreateSettingsViews(UI::ViewGroup *parent) {
groups->SetPadding(Margins(0, 12, 0, 0));
groups->SetSpacing(12.0f);
ChoiceGroup *resetChoices = groups->Add(new ChoiceGroup(""));
ChoiceGroup *resetChoices = groups->Add(new ChoiceGroup());
resetChoices->Add(new Choice(km->T("Clear All")))->OnClick.Add([](UI::EventParams &) {
KeyMap::ClearAllMappings();
});
@@ -246,7 +245,7 @@ void ControlMappingScreen::CreateSettingsViews(UI::ViewGroup *parent) {
KeyMap::RestoreDefault();
});
ChoiceGroup *moreChoices = groups->Add(new ChoiceGroup(""));
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.
@@ -540,6 +539,7 @@ void AnalogCalibrationScreen::CreateSettingsViews(UI::ViewGroup *scrollContents)
auto co = GetI18NCategory(I18NCat::CONTROLS);
ChoiceGroupList *groups = scrollContents->Add(new ChoiceGroupList());
groups->SetSpacing(12.0f);
ChoiceGroup *analogSettings = groups->Add(new ChoiceGroup(co->T("Analog Settings")));
@@ -568,7 +568,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()));
groups->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) {
@@ -908,28 +908,30 @@ void VisualMappingScreen::CreateViews() {
using namespace UI;
auto km = GetI18NCategory(I18NCat::KEYMAPPING);
auto di = GetI18NCategory(I18NCat::DIALOG);
root_ = new LinearLayout(ORIENT_HORIZONTAL);
constexpr float leftColumnWidth = 200.0f;
LinearLayout *leftColumn = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(leftColumnWidth, FILL_PARENT, Margins(10, 0, 0, 10)));
leftColumn->Add(new Choice(km->T("Bind All")))->OnClick.Handle(this, &VisualMappingScreen::OnBindAll);
leftColumn->Add(new CheckBox(&replace_, km->T("Replace"), ""));
LinearLayout *leftColumn = root_->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(leftColumnWidth, FILL_PARENT, Margins(10, 10, 0, 10))));
leftColumn->Add(new Spacer(new LinearLayoutParams(1.0f)));
AddStandardBack(leftColumn);
ChoiceGroup *actions = leftColumn->Add(new ChoiceGroup());
actions->Add(new Choice(km->T("Bind All")))->OnClick.Handle(this, &VisualMappingScreen::OnBindAll);
actions->Add(new CheckBox(&replace_, km->T("Replace"), ""));
Choice *backButton = leftColumn->Add(new Choice(di->T("Back"), ImageID("I_NAVIGATE_BACK")));
backButton->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
backButton->SetRoundCorners();
// TODO: Properly use layout instead of querying bounds.
Bounds bounds = GetLayoutBounds(*screenManager()->getUIContext());
// Account for left side.
bounds.w -= leftColumnWidth + 10.0f;
AnchorLayout *rightColumn = new AnchorLayout(new LinearLayoutParams(bounds.w, FILL_PARENT, 1.0f));
AnchorLayout *rightColumn = root_->Add(new AnchorLayout(new LinearLayoutParams(bounds.w, FILL_PARENT, 1.0f)));
psp_ = rightColumn->Add(new MockPSP(new AnchorLayoutParams(bounds.centerX(), bounds.centerY(), NONE, NONE, Centering::Both)));
psp_->ButtonClick.Handle(this, &VisualMappingScreen::OnMapButton);
root_->Add(leftColumn);
root_->Add(rightColumn);
}
bool VisualMappingScreen::key(const KeyInput &key) {