From 6f57a49f07955c74dc94dd2e8c89beeef297a76c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 15 Mar 2026 14:59:03 +0100 Subject: [PATCH] Default touch control layout improvement in portrait, fix insets on pause screen in portrait --- UI/GamepadEmu.cpp | 5 ++++- UI/PauseScreen.h | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/UI/GamepadEmu.cpp b/UI/GamepadEmu.cpp index 6bcf4442ac..fd37328a12 100644 --- a/UI/GamepadEmu.cpp +++ b/UI/GamepadEmu.cpp @@ -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); diff --git a/UI/PauseScreen.h b/UI/PauseScreen.h index cc94f34680..5cf57ac5f3 100644 --- a/UI/PauseScreen.h +++ b/UI/PauseScreen.h @@ -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;