Default touch control layout improvement in portrait, fix insets on pause screen in portrait

This commit is contained in:
Henrik Rydgård
2026-03-15 14:59:03 +01:00
parent 3352df3ae7
commit 6f57a49f07
2 changed files with 7 additions and 2 deletions
+4 -1
View File
@@ -824,7 +824,8 @@ void InitPadLayout(TouchControlConfig *config, DeviceOrientation orientation, fl
const float scale = globalScale;
const int halfW = xres / 2;
const float screenBottom = orientation == DeviceOrientation::Portrait ? (yres - yres * 0.13f) : yres;
const bool portrait = orientation == DeviceOrientation::Portrait;
const float screenBottom = portrait ? (yres - yres * 0.13f) : yres;
auto initTouchPos = [=](ConfigTouchPos *touch, float x, float y, float extraScale = 1.0f) {
if (touch->x == -1.0f || touch->y == -1.0f) {
@@ -863,6 +864,8 @@ void InitPadLayout(TouchControlConfig *config, DeviceOrientation orientation, fl
int Action_button_center_Y = screenBottom - Action_button_spacing * 2;
if (config->touchRightAnalogStick.show) {
Action_button_center_Y -= 150 * scale;
} else if (portrait) {
Action_button_center_Y -= 120 * scale;
}
initTouchPos(&config->touchActionButtonCenter, Action_button_center_X, Action_button_center_Y);
+3 -1
View File
@@ -41,7 +41,9 @@ protected:
void CreateViews() override;
void update() override;
UI::Margins RootMargins() const override;
ViewLayoutMode LayoutMode() const override {
return ViewLayoutMode::ApplyInsets;
}
// For processing of certain mapped keys.
bool UnsyncKey(const KeyInput &key) override;
void UnsyncAxis(const AxisInput *axes, size_t count) override;