mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-31 19:47:06 +01:00
On the iPhone Duo's cover screen, the camera sits in a box in the top right corner, which gives a side inset down the whole right edge in portrait. The controls are far below it, so they lose width for nothing. iOS 27.1 reports the box as an occlusion region, and from that we report how far down the side insets are needed (SYSPROP_DISPLAY_SIDE_INSETS_BOTTOM). When that's within the top third, the game screen and the touch layout editor skip the side insets. The rest of the UI, including the FPS counter, still keeps them. The regions can show up after the size and insets have settled, so the insets are now recomputed on every layout, and a screen recreates its views when its layout mode changes, since the touch controls are placed for the bounds they were created in. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
51 lines
1.7 KiB
C++
51 lines
1.7 KiB
C++
// Copyright (c) 2013- PPSSPP Project.
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
// Official git repository and contact information can be found at
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
#pragma once
|
|
|
|
#include "Common/UI/View.h"
|
|
#include "Common/UI/ViewGroup.h"
|
|
#include "Common/UI/TabHolder.h"
|
|
#include "BaseScreens.h"
|
|
|
|
class ControlLayoutView;
|
|
|
|
class TouchControlLayoutScreen : public UIBaseDialogScreen {
|
|
public:
|
|
// The controls go where they will be in the game.
|
|
bool LimitContentArea() const override { return false; }
|
|
TouchControlLayoutScreen(const Path &gamePath) : UIBaseDialogScreen(gamePath) {}
|
|
|
|
void CreateViews() override;
|
|
void dialogFinished(const Screen *dialog, DialogResult result) override;
|
|
void onFinish(DialogResult reason) override;
|
|
void update() override;
|
|
void resized() override;
|
|
|
|
const char *tag() const override { return "TouchControlLayout"; }
|
|
|
|
protected:
|
|
// The same as EmuScreen's, so the controls go where they will be in the game.
|
|
ViewLayoutMode LayoutMode() const override;
|
|
void OnReset(UI::EventParams &e);
|
|
void OnMode(UI::EventParams &e);
|
|
|
|
private:
|
|
UI::ChoiceStrip *mode_ = nullptr;
|
|
ControlLayoutView *layoutView_ = nullptr;
|
|
};
|