mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 01:29:41 +01:00
Switch to vertical layout automatically as the window is being resized
Prevents ending up in the wrong layout on startup and being unable to fix it without restarting the emulator.
This commit is contained in:
1 parent
8a7573004d
commit
498136bbf8
2 files changed
+14
-1
No files matched your search
+11
-1
@@ -707,6 +707,7 @@ UI::EventReturn GameBrowser::NavigateClick(UI::EventParams &e) {
|
||||
MainScreen::MainScreen() : highlightProgress_(0.0f), prevHighlightProgress_(0.0f), backFromStore_(false), lockBackgroundAudio_(false) {
|
||||
System_SendMessage("event", "mainscreen");
|
||||
SetBackgroundAudioGame("");
|
||||
lastVertical_ = UseVerticalLayout();
|
||||
}
|
||||
|
||||
MainScreen::~MainScreen() {
|
||||
@@ -721,7 +722,7 @@ void MainScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
// Vertical mode is not finished.
|
||||
bool vertical = dp_yres > dp_xres;
|
||||
bool vertical = UseVerticalLayout();
|
||||
|
||||
I18NCategory *m = GetI18NCategory("MainMenu");
|
||||
|
||||
@@ -906,6 +907,15 @@ void MainScreen::sendMessage(const char *message, const char *value) {
|
||||
void MainScreen::update(InputState &input) {
|
||||
UIScreen::update(input);
|
||||
UpdateUIState(UISTATE_MENU);
|
||||
bool vertical = UseVerticalLayout();
|
||||
if (vertical != lastVertical_) {
|
||||
RecreateViews();
|
||||
lastVertical_ = vertical;
|
||||
}
|
||||
}
|
||||
|
||||
bool MainScreen::UseVerticalLayout() const {
|
||||
return dp_yres > dp_xres * 1.1f;
|
||||
}
|
||||
|
||||
UI::EventReturn MainScreen::OnLoadFile(UI::EventParams &e) {
|
||||
|
||||
Reference in new issue
Block a user