mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Rename "vertical layout" to "portrait layout", to avoid confusion
This commit is contained in:
1 parent
0397fe5e91
commit
acf273a55a
12 files changed
+30
-28
No files matched your search
@@ -18,14 +18,14 @@ static const bool ClickDebug = false;
|
||||
|
||||
UIScreen::UIScreen()
|
||||
: Screen() {
|
||||
lastVertical_ = UseVerticalLayout();
|
||||
lastPortrait_ = UsePortraitLayout();
|
||||
}
|
||||
|
||||
UIScreen::~UIScreen() {
|
||||
delete root_;
|
||||
}
|
||||
|
||||
bool UIScreen::UseVerticalLayout() const {
|
||||
bool UIScreen::UsePortraitLayout() const {
|
||||
return g_display.dp_yres > g_display.dp_xres * 1.1f;
|
||||
}
|
||||
|
||||
@@ -140,10 +140,10 @@ bool UIScreen::UnsyncKey(const KeyInput &key) {
|
||||
}
|
||||
|
||||
void UIScreen::update() {
|
||||
bool vertical = UseVerticalLayout();
|
||||
if (vertical != lastVertical_) {
|
||||
bool portrait = UsePortraitLayout();
|
||||
if (portrait != lastPortrait_) {
|
||||
RecreateViews();
|
||||
lastVertical_ = vertical;
|
||||
lastPortrait_ = portrait;
|
||||
}
|
||||
|
||||
DoRecreateViews();
|
||||
|
||||
@@ -61,7 +61,7 @@ protected:
|
||||
virtual void CreateViews() = 0;
|
||||
|
||||
void RecreateViews() override { recreateViews_ = true; }
|
||||
bool UseVerticalLayout() const;
|
||||
bool UsePortraitLayout() const;
|
||||
|
||||
UI::ViewGroup *root_ = nullptr;
|
||||
Vec3 translation_ = Vec3(0.0f);
|
||||
@@ -78,7 +78,7 @@ protected:
|
||||
void DoRecreateViews();
|
||||
|
||||
bool recreateViews_ = true;
|
||||
bool lastVertical_;
|
||||
bool lastPortrait_;
|
||||
|
||||
private:
|
||||
std::mutex eventQueueLock_;
|
||||
|
||||
@@ -559,6 +559,8 @@ void AnalogSetupScreen::CreateViews() {
|
||||
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
const bool portrait = UsePortraitLayout();
|
||||
|
||||
root_ = new LinearLayout(ORIENT_HORIZONTAL);
|
||||
|
||||
LinearLayout *leftColumn = root_->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(300.0f, FILL_PARENT, Margins(10, 0, 0, 10))));
|
||||
|
||||
@@ -200,14 +200,14 @@ void DisplayLayoutScreen::CreateViews() {
|
||||
|
||||
root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
|
||||
bool vertical = bounds.h > bounds.w;
|
||||
const bool portrait = UsePortraitLayout();
|
||||
|
||||
// Make it so that a touch can only affect one view. Makes manipulating the background through the buttons
|
||||
// impossible.
|
||||
root_->SetExclusiveTouch(true);
|
||||
|
||||
LinearLayout *leftColumn;
|
||||
if (!vertical) {
|
||||
if (!portrait) {
|
||||
ScrollView *leftScrollView = new ScrollView(ORIENT_VERTICAL, new AnchorLayoutParams(420.0f, FILL_PARENT, 0.f, 0.f, NONE, 0.f, false));
|
||||
leftColumn = new LinearLayout(ORIENT_VERTICAL);
|
||||
leftColumn->padding.SetAll(8.0f);
|
||||
@@ -224,7 +224,7 @@ void DisplayLayoutScreen::CreateViews() {
|
||||
root_->Add(rightScrollView);
|
||||
|
||||
LinearLayout *bottomControls;
|
||||
if (vertical) {
|
||||
if (portrait) {
|
||||
bottomControls = new LinearLayout(ORIENT_HORIZONTAL);
|
||||
rightColumn->Add(bottomControls);
|
||||
leftColumn = rightColumn;
|
||||
@@ -295,7 +295,7 @@ void DisplayLayoutScreen::CreateViews() {
|
||||
back->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
|
||||
rightColumn->Add(back);
|
||||
|
||||
if (vertical) {
|
||||
if (portrait) {
|
||||
leftColumn->Add(new Spacer(24.0f));
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ void IAPScreen::CreateViews() {
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto mm = GetI18NCategory(I18NCat::MAINMENU);
|
||||
|
||||
const bool vertical = UseVerticalLayout();
|
||||
const bool vertical = UsePortraitLayout();
|
||||
|
||||
root_ = new LinearLayout(vertical ? ORIENT_VERTICAL : ORIENT_HORIZONTAL, new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
|
||||
|
||||
+1
-1
@@ -1207,7 +1207,7 @@ void MainScreen::CreateViews() {
|
||||
// Scrolling action menu to the right.
|
||||
using namespace UI;
|
||||
|
||||
const bool vertical = UseVerticalLayout();
|
||||
const bool vertical = UsePortraitLayout();
|
||||
|
||||
auto mm = GetI18NCategory(I18NCat::MAINMENU);
|
||||
|
||||
|
||||
+1
-1
@@ -626,7 +626,7 @@ void PromptScreen::CreateViews() {
|
||||
// Scrolling action menu to the right.
|
||||
using namespace UI;
|
||||
|
||||
const bool vertical = UseVerticalLayout();
|
||||
const bool vertical = UsePortraitLayout();
|
||||
|
||||
root_ = new AnchorLayout();
|
||||
ViewGroup *rightColumnItems;
|
||||
|
||||
@@ -561,10 +561,10 @@ void OSDOverlayScreen::DrawForeground(UIContext &ui) {
|
||||
|
||||
void OSDOverlayScreen::update() {
|
||||
// Partial version of UIScreen::update() but doesn't do event processing to avoid duplicate event processing.
|
||||
bool vertical = UseVerticalLayout();
|
||||
if (vertical != lastVertical_) {
|
||||
bool portrait = UsePortraitLayout();
|
||||
if (portrait != lastPortrait_) {
|
||||
RecreateViews();
|
||||
lastVertical_ = vertical;
|
||||
lastPortrait_ = portrait;
|
||||
}
|
||||
|
||||
DoRecreateViews();
|
||||
|
||||
+3
-3
@@ -393,7 +393,7 @@ void GamePauseScreen::CreateSavestateControls(UI::LinearLayout *leftColumnItems,
|
||||
void GamePauseScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
bool vertical = UseVerticalLayout();
|
||||
bool portrait = UsePortraitLayout();
|
||||
|
||||
Margins scrollMargins(0, 10, 0, 0);
|
||||
Margins actionMenuMargins(0, 10, 15, 0);
|
||||
@@ -489,7 +489,7 @@ void GamePauseScreen::CreateViews() {
|
||||
leftColumnItems->Add(new Spacer(30.0f));
|
||||
}
|
||||
|
||||
CreateSavestateControls(leftColumnItems, vertical);
|
||||
CreateSavestateControls(leftColumnItems, portrait);
|
||||
} else {
|
||||
// Let's show the active challenges.
|
||||
std::set<uint32_t> ids = Achievements::GetActiveChallengeIDs();
|
||||
@@ -512,7 +512,7 @@ void GamePauseScreen::CreateViews() {
|
||||
LinearLayout *middleColumn = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(64, FILL_PARENT, Margins(0, 10, 0, 15)));
|
||||
root_->Add(middleColumn);
|
||||
middleColumn->SetSpacing(0.0f);
|
||||
ViewGroup *rightColumnHolder = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(vertical ? 200 : 300, FILL_PARENT, actionMenuMargins));
|
||||
ViewGroup *rightColumnHolder = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(portrait ? 200 : 300, FILL_PARENT, actionMenuMargins));
|
||||
|
||||
ViewGroup *rightColumn = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(1.0f));
|
||||
rightColumnHolder->Add(rightColumn);
|
||||
|
||||
@@ -591,7 +591,7 @@ void RemoteISOBrowseScreen::CreateViews() {
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
auto ri = GetI18NCategory(I18NCat::REMOTEISO);
|
||||
|
||||
bool vertical = UseVerticalLayout();
|
||||
bool portrait = UsePortraitLayout();
|
||||
|
||||
using namespace UI;
|
||||
|
||||
@@ -624,7 +624,7 @@ void RemoteISOBrowseScreen::CreateViews() {
|
||||
|
||||
rightColumnItems->Add(new Choice(di->T("Back"), "", false, new AnchorLayoutParams(150, WRAP_CONTENT, 10, NONE, NONE, 10)))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
|
||||
|
||||
if (vertical) {
|
||||
if (portrait) {
|
||||
root_ = new LinearLayout(ORIENT_VERTICAL);
|
||||
rightColumn->ReplaceLayoutParams(new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
|
||||
leftColumn->ReplaceLayoutParams(new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 1.0));
|
||||
|
||||
@@ -31,7 +31,7 @@ void TabbedUIDialogScreenWithGameBackground::AddTab(const char *tag, std::string
|
||||
void TabbedUIDialogScreenWithGameBackground::CreateViews() {
|
||||
PreCreateViews();
|
||||
|
||||
bool vertical = UseVerticalLayout() || ForceHorizontalTabs();
|
||||
bool portrait = UsePortraitLayout() || ForceHorizontalTabs();
|
||||
|
||||
// Information in the top left.
|
||||
// Back button to the bottom left.
|
||||
@@ -44,7 +44,7 @@ void TabbedUIDialogScreenWithGameBackground::CreateViews() {
|
||||
filterNotice_ = new TextView("(filter notice, you shouldn't see this text", new LinearLayoutParams(Margins(20, 5)));
|
||||
filterNotice_->SetVisibility(V_GONE);
|
||||
|
||||
if (vertical) {
|
||||
if (portrait) {
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
LinearLayout *verticalLayout = new LinearLayout(ORIENT_VERTICAL, new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
tabHolder_ = new TabHolder(ORIENT_HORIZONTAL, 200, TabHolderFlags::BackButton, filterNotice_, new LinearLayoutParams(1.0f));
|
||||
@@ -62,7 +62,7 @@ void TabbedUIDialogScreenWithGameBackground::CreateViews() {
|
||||
root_->SetDefaultFocusView(tabHolder_);
|
||||
|
||||
float leftSide = 40.0f;
|
||||
if (!vertical) {
|
||||
if (!portrait) {
|
||||
leftSide += 200.0f;
|
||||
}
|
||||
settingInfo_ = new SettingInfoMessage(ALIGN_CENTER | FLAG_WRAP_TEXT, g_display.dp_yres - 200.0f, new AnchorLayoutParams(
|
||||
|
||||
@@ -37,14 +37,14 @@ void TiltAnalogSettingsScreen::CreateViews() {
|
||||
auto co = GetI18NCategory(I18NCat::CONTROLS);
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
|
||||
bool vertical = UseVerticalLayout();
|
||||
bool portrait = UsePortraitLayout();
|
||||
|
||||
root_ = new LinearLayout(vertical ? ORIENT_VERTICAL : ORIENT_HORIZONTAL);
|
||||
root_ = new LinearLayout(portrait ? ORIENT_VERTICAL : ORIENT_HORIZONTAL);
|
||||
root_->SetTag("TiltAnalogSettings");
|
||||
|
||||
LinearLayout *settings = new LinearLayoutList(ORIENT_VERTICAL);
|
||||
|
||||
if (vertical) {
|
||||
if (portrait) {
|
||||
// Don't need a scrollview, probably..
|
||||
root_->Add(settings);
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user