Prepare for adding more sensible back buttons to TabbedDialogScreen portrait mode

This commit is contained in:
Henrik Rydgård committed 2025-10-23 12:46:07 +02:00
1 parent b45d07d6cb
commit 7b743071d2
15 files changed
+86 -37

No files matched your search

+2
View File
@@ -884,6 +884,8 @@ add_library(Common STATIC
Common/UI/ViewGroup.h
Common/UI/ScrollView.cpp
Common/UI/ScrollView.h
Common/UI/TabHolder.cpp
Common/UI/TabHolder.h
Common/UI/PopupScreens.cpp
Common/UI/PopupScreens.h
Common/BitScan.h
+1 -1
View File
@@ -8,7 +8,7 @@
namespace UI {
TabHolder::TabHolder(Orientation orientation, float stripSize, View *bannerView, LayoutParams *layoutParams)
TabHolder::TabHolder(Orientation orientation, float stripSize, TabHolderFlags flags, View *bannerView, LayoutParams *layoutParams)
: LinearLayout(Opposite(orientation), layoutParams) {
SetSpacing(0.0f);
if (orientation == ORIENT_HORIZONTAL) {
+7 -1
View File
@@ -11,9 +11,15 @@ namespace UI {
class ChoiceStrip;
class ScrollView;
enum class TabHolderFlags {
Default = 0,
BackButton = 1,
};
ENUM_CLASS_BITOPS(TabHolderFlags);
class TabHolder : public LinearLayout {
public:
TabHolder(Orientation orientation, float stripSize, View *bannerView, LayoutParams *layoutParams = 0);
TabHolder(Orientation orientation, float stripSize, TabHolderFlags flags, View *bannerView, LayoutParams *layoutParams);
template <class T>
T *AddTab(std::string_view title, T *tabContents) {
+2 -2
View File
@@ -474,7 +474,7 @@ void ShaderListScreen::CreateViews() {
LinearLayout *layout = new LinearLayout(ORIENT_VERTICAL);
root_ = layout;
tabs_ = new TabHolder(ORIENT_HORIZONTAL, 40, nullptr, new LinearLayoutParams(1.0));
tabs_ = new TabHolder(ORIENT_HORIZONTAL, 40, TabHolderFlags::Default, nullptr, new LinearLayoutParams(1.0));
tabs_->SetTag("DevShaderList");
layout->Add(tabs_);
layout->Add(new Button(di->T("Back")))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
@@ -549,7 +549,7 @@ void FrameDumpTestScreen::CreateViews() {
auto di = GetI18NCategory(I18NCat::DIALOG);
TabHolder *tabHolder;
tabHolder = new TabHolder(ORIENT_VERTICAL, 200, nullptr, new AnchorLayoutParams(10, 0, 10, 0, false));
tabHolder = new TabHolder(ORIENT_VERTICAL, 200, TabHolderFlags::Default, nullptr, new AnchorLayoutParams(10, 0, 10, 0, false));
root_->Add(tabHolder);
tabHolder->AddBack(this);
tabHolder->SetTag("DumpTypes");
+1 -1
View File
@@ -301,7 +301,7 @@ void GPUDriverTestScreen::CreateViews() {
AnchorLayout *anchor = new AnchorLayout();
root_ = anchor;
tabHolder_ = new TabHolder(ORIENT_HORIZONTAL, 30.0f, nullptr, new AnchorLayoutParams(FILL_PARENT, FILL_PARENT, false));
tabHolder_ = new TabHolder(ORIENT_HORIZONTAL, 30.0f, TabHolderFlags::Default, nullptr, new AnchorLayoutParams(FILL_PARENT, FILL_PARENT, false));
anchor->Add(tabHolder_);
tabHolder_->AddTab("Discard", new LinearLayout(ORIENT_VERTICAL));
tabHolder_->AddTab("Shader", new LinearLayout(ORIENT_VERTICAL));
+1 -1
View File
@@ -2043,7 +2043,7 @@ void GestureMappingScreen::CreateViews() {
root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
AddStandardBack(root_);
TabHolder *tabHolder = new TabHolder(ORIENT_VERTICAL, 200, nullptr, new AnchorLayoutParams(10, 0, 10, 0, false));
TabHolder *tabHolder = new TabHolder(ORIENT_VERTICAL, 200, TabHolderFlags::Default, nullptr, new AnchorLayoutParams(10, 0, 10, 0, false));
root_->Add(tabHolder);
ScrollView *rightPanel = new ScrollView(ORIENT_VERTICAL);
tabHolder->AddTab(co->T("Gesture"), rightPanel);
+2 -2
View File
@@ -1131,7 +1131,7 @@ void MainScreen::CreateViews() {
auto mm = GetI18NCategory(I18NCat::MAINMENU);
tabHolder_ = new TabHolder(ORIENT_HORIZONTAL, 64, nullptr, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 1.0f));
tabHolder_ = new TabHolder(ORIENT_HORIZONTAL, 64, TabHolderFlags::Default, nullptr, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 1.0f));
ViewGroup *leftColumn = tabHolder_;
tabHolder_->SetTag("MainScreenGames");
gameBrowsers_.clear();
@@ -1568,7 +1568,7 @@ void UmdReplaceScreen::CreateViews() {
auto mm = GetI18NCategory(I18NCat::MAINMENU);
auto di = GetI18NCategory(I18NCat::DIALOG);
TabHolder *leftColumn = new TabHolder(ORIENT_HORIZONTAL, 64, nullptr, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 1.0));
TabHolder *leftColumn = new TabHolder(ORIENT_HORIZONTAL, 64, TabHolderFlags::Default, nullptr, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 1.0));
leftColumn->SetTag("UmdReplace");
leftColumn->SetClip(true);
+1 -1
View File
@@ -595,7 +595,7 @@ void RemoteISOBrowseScreen::CreateViews() {
using namespace UI;
TabHolder *leftColumn = new TabHolder(ORIENT_HORIZONTAL, 64, nullptr, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
TabHolder *leftColumn = new TabHolder(ORIENT_HORIZONTAL, 64, TabHolderFlags::Default, nullptr, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
tabHolder_ = leftColumn;
tabHolder_->SetTag("RemoteGames");
gameBrowsers_.clear();
+2 -2
View File
@@ -40,13 +40,13 @@ void TabbedUIDialogScreenWithGameBackground::CreateViews() {
if (vertical) {
auto di = GetI18NCategory(I18NCat::DIALOG);
LinearLayout *verticalLayout = new LinearLayout(ORIENT_VERTICAL, new LayoutParams(FILL_PARENT, FILL_PARENT));
tabHolder_ = new TabHolder(ORIENT_HORIZONTAL, 200, filterNotice_, new LinearLayoutParams(1.0f));
tabHolder_ = new TabHolder(ORIENT_HORIZONTAL, 200, TabHolderFlags::BackButton, filterNotice_, new LinearLayoutParams(1.0f));
verticalLayout->Add(tabHolder_);
CreateExtraButtons(verticalLayout, 0);
verticalLayout->Add(new Choice(di->T("Back"), "", false, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 0.0f, Margins(10, 0))))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
root_->Add(verticalLayout);
} else {
tabHolder_ = new TabHolder(ORIENT_VERTICAL, 200, filterNotice_, new AnchorLayoutParams(10, 0, 10, 0, false));
tabHolder_ = new TabHolder(ORIENT_VERTICAL, 200, TabHolderFlags::Default, filterNotice_, new AnchorLayoutParams(10, 0, 10, 0, false));
CreateExtraButtons(tabHolder_->Container(), 10);
tabHolder_->AddBack(this);
root_->Add(tabHolder_);
+2 -2
View File
@@ -58,7 +58,7 @@ void TouchControlVisibilityScreen::CreateViews() {
Choice *toggleAll = new Choice(di->T("Toggle All"), "", false, new AnchorLayoutParams(leftColumnWidth - 10, WRAP_CONTENT, 10, NONE, NONE, 84));
root_->Add(toggleAll)->OnClick.Handle(this, &TouchControlVisibilityScreen::OnToggleAll);
TabHolder *tabHolder = new TabHolder(ORIENT_VERTICAL, leftColumnWidth, nullptr, new AnchorLayoutParams(10, 0, 10, 0, false));
TabHolder *tabHolder = new TabHolder(ORIENT_VERTICAL, leftColumnWidth, TabHolderFlags::Default, nullptr, new AnchorLayoutParams(10, 0, 10, 0, false));
tabHolder->SetTag("TouchControlVisibility");
root_->Add(tabHolder);
ScrollView *rightPanel = new ScrollView(ORIENT_VERTICAL);
@@ -143,7 +143,7 @@ void RightAnalogMappingScreen::CreateViews() {
root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
Choice *back = new Choice(di->T("Back"), "", false, new AnchorLayoutParams(leftColumnWidth - 10, WRAP_CONTENT, 10, NONE, NONE, 10));
root_->Add(back)->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
TabHolder *tabHolder = new TabHolder(ORIENT_VERTICAL, leftColumnWidth, nullptr, new AnchorLayoutParams(10, 0, 10, 0, false));
TabHolder *tabHolder = new TabHolder(ORIENT_VERTICAL, leftColumnWidth, TabHolderFlags::Default, nullptr, new AnchorLayoutParams(10, 0, 10, 0, false));
root_->Add(tabHolder);
ScrollView *rightPanel = new ScrollView(ORIENT_VERTICAL);
tabHolder->AddTab(co->T("Binds"), rightPanel);
+3
View File
@@ -134,6 +134,9 @@ static const ImageMeta imageIDs[] = {
{"I_FILLED_CIRCLE_3", false},
{"I_FILLED_CIRCLE_4", false},
{"I_FILLED_CIRCLE_5", false},
{"I_SETTINGS_DISPLAY", false},
{"I_NAVIGATE_BACK", false},
{"I_NAVIGATE_FORWARD", false},
};
static std::string PNGNameFromID(std::string_view id) {
+2
View File
@@ -221,6 +221,7 @@
<ClInclude Include="..\..\Common\UI\Root.h" />
<ClInclude Include="..\..\Common\UI\Screen.h" />
<ClInclude Include="..\..\Common\UI\ScrollView.h" />
<ClInclude Include="..\..\Common\UI\TabHolder.h" />
<ClInclude Include="..\..\Common\UI\Tween.h" />
<ClInclude Include="..\..\Common\UI\UI.h" />
<ClInclude Include="..\..\Common\UI\UIScreen.h" />
@@ -384,6 +385,7 @@
<ClCompile Include="..\..\Common\UI\Root.cpp" />
<ClCompile Include="..\..\Common\UI\Screen.cpp" />
<ClCompile Include="..\..\Common\UI\ScrollView.cpp" />
<ClCompile Include="..\..\Common\UI\TabHolder.cpp" />
<ClCompile Include="..\..\Common\UI\Tween.cpp" />
<ClCompile Include="..\..\Common\UI\UI.cpp" />
<ClCompile Include="..\..\Common\UI\UIScreen.cpp" />
+6
View File
@@ -523,6 +523,9 @@
<ClCompile Include="..\..\Common\Render\AtlasGen.cpp">
<Filter>Render</Filter>
</ClCompile>
<ClCompile Include="..\..\Common\UI\TabHolder.cpp">
<Filter>UI</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="targetver.h" />
@@ -1005,6 +1008,9 @@
<ClInclude Include="..\..\Common\Render\AtlasGen.h">
<Filter>Render</Filter>
</ClInclude>
<ClInclude Include="..\..\Common\UI\TabHolder.h">
<Filter>UI</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\Common\Math\fast\fast_matrix_neon.S">
+1
View File
@@ -365,6 +365,7 @@ EXEC_AND_LIB_FILES := \
$(SRC)/Common/UI/View.cpp \
$(SRC)/Common/UI/ViewGroup.cpp \
$(SRC)/Common/UI/ScrollView.cpp \
$(SRC)/Common/UI/TabHolder.cpp \
$(SRC)/Common/UI/PopupScreens.cpp \
$(SRC)/Common/Serialize/Serializer.cpp \
$(SRC)/Common/ArmCPUDetect.cpp \
+53 -24
View File
@@ -24,9 +24,9 @@
inkscape:pagecheckerboard="true"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="px"
inkscape:zoom="2.0000001"
inkscape:cx="467.24999"
inkscape:cy="319.24999"
inkscape:zoom="8.0000002"
inkscape:cx="328.24999"
inkscape:cy="324.43749"
inkscape:window-width="3840"
inkscape:window-height="2071"
inkscape:window-x="-9"
@@ -34,7 +34,39 @@
inkscape:window-maximized="1"
inkscape:current-layer="layer1"
showgrid="false" /><defs
id="defs1"><pattern
id="defs1"><inkscape:path-effect
effect="fillet_chamfer"
id="path-effect115"
is_visible="true"
lpeversion="1"
nodesatellites_param="F,0,0,1,0,0,0,1 @ F,0,0,1,0,3.5817967,0,1 @ F,0,0,1,0,3.7372395,0,1 @ F,0,0,1,0,0,0,1"
radius="0"
unit="px"
method="auto"
mode="F"
chamfer_steps="1"
flexible="false"
use_knot_distance="true"
apply_no_radius="true"
apply_with_radius="true"
only_selected="false"
hide_knots="false" /><inkscape:path-effect
effect="fillet_chamfer"
id="path-effect114"
is_visible="true"
lpeversion="1"
nodesatellites_param="F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1 @ F,0,0,1,0,3.6049479,0,1 @ F,0,0,1,0,0,0,1"
radius="0"
unit="px"
method="auto"
mode="F"
chamfer_steps="1"
flexible="false"
use_knot_distance="true"
apply_no_radius="true"
apply_with_radius="true"
only_selected="false"
hide_knots="false" /><pattern
inkscape:collect="always"
xlink:href="#Polkadots-largewhite"
id="pattern6"
@@ -3324,7 +3356,7 @@
id="I_SLIDERS"
inkscape:export-xdpi="135"
inkscape:export-ydpi="135"
transform="matrix(0.39901994,0,0,0.39901994,60.74866,2.8515099)"><path
transform="matrix(0.39901994,0,0,0.39901994,61.497015,2.8515099)"><path
inkscape:export-ydpi="135"
inkscape:export-xdpi="135"
inkscape:export-filename="C:\dev\ppsspp\source_assets\image\cross.png"
@@ -4094,7 +4126,7 @@
d="m 77.456771,85.195834 a 0.79374999,0.79374999 0 0 0 -0.79375,0.79375 0.79374999,0.79374999 0 0 0 0.292489,0.613916 1.190625,1.5875 0 0 1 0.501261,-0.150895 1.190625,1.5875 0 0 1 0.503329,0.149345 0.79374999,0.79374999 0 0 0 0.290421,-0.612366 0.79374999,0.79374999 0 0 0 -0.79375,-0.79375 z"
id="path105" /></g><g
id="I_DEVMENU"
transform="matrix(0.65373915,0,0,1.1128176,94.092836,49.801341)"><path
transform="matrix(0.65373915,0,0,1.1128176,94.654102,49.801341)"><path
d="m 33.569297,74.195706 v 1.188799 h 8.094462 v -1.188799 z"
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0;stroke-dasharray:none"
sodipodi:nodetypes="ccccc"
@@ -4129,8 +4161,8 @@
id="I_FILLED_CIRCLE_1"
style="fill:#ffffff;stroke-width:4.93273"
d="m 106.54699,103.13263 a 2.5724686,2.5724686 0 0 1 2.57247,-2.57246 2.5724686,2.5724686 0 0 1 2.57247,2.57246 2.5724686,2.5724686 0 0 1 -2.57247,2.57247 2.5724686,2.5724686 0 0 1 -2.57247,-2.57247 z" /><g
id="g2"
transform="matrix(1.7225478,0,0,1.7225478,-72.616601,31.888468)">
id="I_SETTINGS_DISPLAY"
transform="matrix(1.7225478,0,0,1.7225478,-72.335968,31.982012)">
<path
d="m 94.898083,57.771045 h 5.016673 0.116084 v 0.116081 3.861938 0.116081 h -0.116084 -1.630619 v 0.193005 h 0.406285 v 0.287413 H 96.069104 V 62.05815 h 0.406285 v -0.193005 h -1.577306 -0.116082 v -0.116081 -3.861938 -0.116081 z m 4.694422,0.330476 H 95.2473 v 3.44158 h 4.344643 z"
@@ -4139,27 +4171,24 @@
sodipodi:nodetypes="cccccccccccccccccccccccccc" />
<path
sodipodi:type="star"
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:11.6107"
id="path111"
inkscape:flatsided="false"
sodipodi:sides="5"
sodipodi:cx="557.73047"
sodipodi:cy="449.27795"
sodipodi:r1="7.1638193"
sodipodi:r2="3.5819099"
sodipodi:arg1="1.4097044"
sodipodi:arg2="2.038023"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 558.87952,456.34902 -2.76239,-3.87306 -4.75657,0.0799 2.82988,-3.82402 -1.54584,-4.49909 4.51134,1.50969 3.8012,-2.86047 -0.0417,4.75706 3.89511,2.73121 -4.53713,1.43034 z"
transform="matrix(0.10169027,0,0,0.10169027,41.995181,13.200137)"
style="fill:#ffffff;stroke-width:11.6107"
inkscape:transform-center-x="-0.062198264"
inkscape:transform-center-y="0.059124851" /></g><g
inkscape:transform-center-y="0.059124851"
transform="matrix(0.10169027,0,0,0.10169027,41.995181,13.200137)"
d="m 558.87952,456.34902 -2.76239,-3.87306 -4.75657,0.0799 2.82988,-3.82402 -1.54584,-4.49909 4.51134,1.50969 3.8012,-2.86047 -0.0417,4.75706 3.89511,2.73121 -4.53713,1.43034 z" /></g><g
label="Layer 1"
id="imagebot_2"
transform="matrix(0.01509008,0,0,0.01509008,136.32844,129.24515)"><g
transform="translate(-88.0347,-233.58799)"
label="Layer 1"
id="imagebot_3" /><title
id="title1">Layer 1</title></g></g></svg>
id="title1">Layer 1</title></g><path
id="I_NAVIGATE_BACK"
style="color:#000000;fill:#ececec;stroke-width:0.788011;stroke-miterlimit:4.8;-inkscape-stroke:none"
d="m 63.647278,81.038465 -2.447396,2.447396 2.447396,2.446879 0.517281,-0.515731 -1.41025,-1.409734 h 3.366203 c 1.344769,0 2.424142,1.079372 2.424142,2.424142 v 0.304891 c 0,1.27712 -1.024032,2.300634 -2.301153,2.300634 h -3.379638 v 1.042314 h 3.379638 c 1.840515,0 3.342949,-1.502434 3.342949,-3.342948 v -0.304891 c 0,-1.908164 -1.557775,-3.467489 -3.465938,-3.467489 h -3.365686 l 1.409733,-1.409733 z" /><g
id="g116"
transform="matrix(0.78801051,0,0,0.78801051,6.4133173,16.663336)" /><path
id="I_NAVIGATE_FORWARD"
style="color:#000000;fill:#ececec;stroke-width:0.788011;stroke-miterlimit:4.8;-inkscape-stroke:none"
d="m 78.218481,81.071537 2.447396,2.447396 -2.447396,2.446879 -0.517281,-0.51573 1.41025,-1.409734 h -3.366203 c -1.344769,0 -2.424142,1.079372 -2.424142,2.424142 v 0.304891 c 0,1.277119 1.024032,2.300634 2.301153,2.300634 h 3.379638 v 1.042314 h -3.379638 c -1.840515,0 -3.342949,-1.502434 -3.342949,-3.342948 V 86.46449 c 0,-1.908164 1.557775,-3.467489 3.465938,-3.467489 h 3.365686 L 77.7012,81.587268 Z" /></g></svg>

Before

Width:  |  Height:  |  Size: 200 KiB

After

Width:  |  Height:  |  Size: 202 KiB