Fix some more minor inset-related layout issues

This commit is contained in:
Henrik Rydgård committed 2026-03-15 15:21:28 +01:00
1 parent 6f57a49f07
commit e1ee966767
3 files changed
+11 -9

No files matched your search

+4
View File
@@ -38,6 +38,10 @@ protected:
void dialogFinished(const Screen *dialog, DialogResult result) override;
std::string_view GetTitle() const override;
ViewLayoutMode LayoutMode() const override {
return ViewLayoutMode::IgnoreBottomInset;
}
private:
void saveArray();
+4 -4
View File
@@ -32,7 +32,7 @@ void UISimpleBaseDialogScreen::CreateViews() {
if (flags_ & SimpleDialogFlags::ContentsCanScroll) {
ScrollView *scroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT, 1.0f));
LinearLayout *contents = new LinearLayoutList(ORIENT_VERTICAL, new LinearLayoutParams(Margins(0, 0, 8, 0)));
LinearLayout *contents = new LinearLayoutList(ORIENT_VERTICAL, new LinearLayoutParams(Margins(0, 0, portrait ? 0 : 8, 0)));
contents->SetSpacing(0);
CreateDialogViews(contents);
scroll->Add(contents);
@@ -45,7 +45,7 @@ void UISimpleBaseDialogScreen::CreateViews() {
ViewLayoutMode UITwoPaneBaseDialogScreen::LayoutMode() const {
const bool portrait = GetDeviceOrientation() == DeviceOrientation::Portrait;
if (portrait) {
if (flags_ & TwoPaneFlags::SettingsCanScroll) {
if ((flags_ & TwoPaneFlags::SettingsCanScroll) || (flags_ & TwoPaneFlags::ContentsCanScroll)) {
return ViewLayoutMode::IgnoreBottomInset;
} else {
return ViewLayoutMode::ApplyInsets;
@@ -111,9 +111,9 @@ void UITwoPaneBaseDialogScreen::CreateViews() {
if (!(flags_ & TwoPaneFlags::SettingsInContextMenu)) {
LinearLayout *settingsPane;
if (flags_ & TwoPaneFlags::SettingsCanScroll) {
settingsPane = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
settingsPane = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, Margins(8)));
settingsPane->SetSpacing(0.0f);
ScrollView *settingsScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT, 1.0f, Margins(8)));
ScrollView *settingsScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT, 1.0f));
settingsScroll->Add(settingsPane);
root->Add(settingsScroll);
} else {
+3 -5
View File
@@ -29,6 +29,7 @@
#include "UI/JoystickHistoryView.h"
#include "UI/GamepadEmu.h"
#include "UI/TiltAnalogSettingsScreen.h"
#include "UI/MiscViews.h"
const char *g_tiltTypes[] = { "None (Disabled)", "Analog Stick", "D-PAD", "PSP Action Buttons", "L/R Trigger Buttons" };
const size_t g_numTiltTypes = ARRAY_SIZE(g_tiltTypes);
@@ -113,15 +114,12 @@ void TiltAnalogSettingsScreen::CreateSettingsViews(UI::ViewGroup *settings) {
});
typeChoice->SetEnabledPtr(&g_Config.bTiltInputEnabled);
settings->Add(new ItemHeader(co->T("Calibration")));
TextView *calibrationInfo = new TextView(co->T("To Calibrate", "Hold device at your preferred angle and press Calibrate."));
calibrationInfo->SetSmall(true);
calibrationInfo->SetPadding(Margins(5));
calibrationInfo->SetAlign(FLAG_WRAP_TEXT);
settings->Add(calibrationInfo);
Choice *calibrate = new Choice(co->T("Calibrate"));
calibrate->OnClick.Handle(this, &TiltAnalogSettingsScreen::OnCalibrate);
calibrate->SetEnabledPtr(&g_Config.bTiltInputEnabled);
settings->Add(calibrate);
SettingHint *calibrationInfo = new SettingHint(co->T("To Calibrate", "Hold device at your preferred angle and press Calibrate."), calibrate);
settings->Add(calibrationInfo);
settings->Add(new ItemHeader(co->T("Sensitivity")));
if (g_Config.iTiltInputType == 1) {