Files
ppsspp/UI/CustomButtonMappingScreen.h
T
Henrik RydgårdandClaude Opus 5.5 58fa522d48 UI: Limit the width of dialog screens, and keep content off the edges of large screens
Dialog screens (tabbed, two-pane, simple and the others built on
UIBaseDialogScreen) center their content at up to 1400 wide, instead of
stretching settings rows and buttons across very wide windows.

On large screens, those screens and the main screen also get an inset on all
sides, since controls right at the edge are hard to see there. It grows with
the screen's smaller dimension, from nothing at 600 to the full inset at
1000, and is always full on TVs. The game, popups, and the screens that
position things to match the game's screen (display layout, touch control
layout and tests, custom button and visual mapping) are left as they were.

The root's bounds are computed by UIScreen::GetContentBounds, since
UI::Margins can't hold widths this large.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 16:12:01 +02:00

56 lines
1.8 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 "UI/BaseScreens.h"
#include "UI/GamepadEmu.h"
#include "UI/SimpleDialogScreen.h"
namespace UI {
class CheckBox;
}
class CustomButtonMappingScreen : public UISimpleBaseDialogScreen {
public:
// Places the button preview from the screen bounds.
bool LimitContentArea() const override { return false; }
CustomButtonMappingScreen(DeviceOrientation deviceOrientation, const Path &gamePath, int id) : UISimpleBaseDialogScreen(gamePath, SimpleDialogFlags::Default), deviceOrientation_(deviceOrientation), id_(id) {}
const char *tag() const override { return "CustomButton"; }
void CreateDialogViews(UI::ViewGroup *parent) override;
void onFinish(DialogResult result) override;
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();
bool array[ARRAY_SIZE(CustomKeyData::g_customKeyList)]{};
bool arrayLoaded_ = false;
int id_;
DeviceOrientation deviceOrientation_;
};