mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-04 03:35:19 +02:00
GameScreen: New look in portrait mode
This commit is contained in:
+23
-10
@@ -1,6 +1,7 @@
|
||||
#include "Common/UI/ScrollView.h"
|
||||
#include "Common/Data/Text/I18n.h"
|
||||
#include "UI/SimpleDialogScreen.h"
|
||||
#include "Common/UI/PopupScreens.h"
|
||||
#include "UI/MiscViews.h"
|
||||
|
||||
void UISimpleBaseDialogScreen::CreateViews() {
|
||||
@@ -12,7 +13,7 @@ void UISimpleBaseDialogScreen::CreateViews() {
|
||||
const bool portrait = GetDeviceOrientation() == DeviceOrientation::Portrait;
|
||||
|
||||
root_ = new LinearLayout(ORIENT_VERTICAL, new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
root_->Add(new TopBar(*screenManager()->getUIContext(), portrait, GetTitle()));
|
||||
root_->Add(new TopBar(*screenManager()->getUIContext(), portrait ? TopBarFlags::Portrait : TopBarFlags::Default, GetTitle()));
|
||||
|
||||
if (canScroll) {
|
||||
ScrollView *scroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT, 1.0f));
|
||||
@@ -37,22 +38,34 @@ void UITwoPaneBaseDialogScreen::CreateViews() {
|
||||
// Portrait layout is just a vertical stack.
|
||||
ignoreBottomInset_ = true;
|
||||
LinearLayout *root = new LinearLayout(ORIENT_VERTICAL, new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
root->Add(new TopBar(*screenManager()->getUIContext(), portrait, GetTitle()));
|
||||
|
||||
TopBarFlags topBarFlags = TopBarFlags::Portrait;
|
||||
if (flags_ & TwoPaneFlags::SettingsInContextMenu) {
|
||||
topBarFlags |= TopBarFlags::ContextMenuButton;
|
||||
}
|
||||
TopBar *topBar = root->Add(new TopBar(*screenManager()->getUIContext(), topBarFlags, GetTitle()));
|
||||
root->SetSpacing(0);
|
||||
CreateContentViews(root);
|
||||
|
||||
ScrollView *settingsScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT, 1.0f, Margins(8)));
|
||||
LinearLayout *settingsPane = new LinearLayout(ORIENT_VERTICAL);
|
||||
settingsScroll->Add(settingsPane);
|
||||
CreateSettingsViews(settingsPane);
|
||||
root->Add(settingsScroll);
|
||||
|
||||
if (flags_ & TwoPaneFlags::SettingsInContextMenu) {
|
||||
topBar->OnContextMenuClick.Add([this](UI::EventParams &e) {
|
||||
this->screenManager()->push(new PopupCallbackScreen([this](UI::ViewGroup *parent) {
|
||||
CreateSettingsViews(parent);
|
||||
}, nullptr));
|
||||
});
|
||||
} else {
|
||||
ScrollView *settingsScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT, 1.0f, Margins(8)));
|
||||
LinearLayout *settingsPane = new LinearLayout(ORIENT_VERTICAL);
|
||||
settingsScroll->Add(settingsPane);
|
||||
CreateSettingsViews(settingsPane);
|
||||
root->Add(settingsScroll);
|
||||
}
|
||||
root_ = root;
|
||||
} else {
|
||||
ignoreBottomInset_ = false;
|
||||
LinearLayout *root = new LinearLayout(ORIENT_VERTICAL, new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
std::string title(GetTitle());
|
||||
root->Add(new TopBar(*screenManager()->getUIContext(), portrait, title));
|
||||
root->Add(new TopBar(*screenManager()->getUIContext(), portrait ? TopBarFlags::Portrait : TopBarFlags::Default, title));
|
||||
root->SetSpacing(0);
|
||||
|
||||
LinearLayout *columns = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT, 1.0f));
|
||||
@@ -67,7 +80,7 @@ void UITwoPaneBaseDialogScreen::CreateViews() {
|
||||
settingsPane->Add(new Choice(di->T("Back"), ImageID("I_NAVIGATE_BACK")))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
|
||||
settingsScroll->Add(settingsPane);
|
||||
|
||||
if (SettingsToTheRight()) {
|
||||
if (flags_ & TwoPaneFlags::SettingsToTheRight) {
|
||||
CreateContentViews(columns);
|
||||
columns->Add(settingsScroll);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user