diff --git a/Common/System/System.h b/Common/System/System.h index 48cfaa280a..1568e43ed5 100644 --- a/Common/System/System.h +++ b/Common/System/System.h @@ -188,6 +188,8 @@ enum SystemProperty { SYSPROP_SKIP_UI, SYSPROP_USER_DOCUMENTS_DIR, + + SYSPROP_OK_BUTTON_LEFT, }; enum class SystemNotification { diff --git a/Common/UI/UIScreen.cpp b/Common/UI/UIScreen.cpp index 94c3c420f7..0d2e3d8e6e 100644 --- a/Common/UI/UIScreen.cpp +++ b/Common/UI/UIScreen.cpp @@ -393,10 +393,8 @@ void PopupScreen::TriggerFinish(DialogResult result) { OnCompleted(result); } -#if PPSSPP_PLATFORM(UWP) // Inform UI that popup close to hide OSK (if visible) System_NotifyUIState("popup_closed"); -#endif } void PopupScreen::CreateViews() { @@ -433,17 +431,17 @@ void PopupScreen::CreateViews() { Margins buttonMargins(5, 5); // Adjust button order to the platform default. -#if defined(_WIN32) - defaultButton_ = buttonRow->Add(new Button(button1_, new LinearLayoutParams(1.0f, buttonMargins))); - defaultButton_->OnClick.Handle(this, &UIScreen::OnOK); - if (!button2_.empty()) - buttonRow->Add(new Button(button2_, new LinearLayoutParams(1.0f, buttonMargins)))->OnClick.Handle(this, &UIScreen::OnCancel); -#else - if (!button2_.empty()) - buttonRow->Add(new Button(button2_, new LinearLayoutParams(1.0f)))->OnClick.Handle(this, &UIScreen::OnCancel); - defaultButton_ = buttonRow->Add(new Button(button1_, new LinearLayoutParams(1.0f))); - defaultButton_->OnClick.Handle(this, &UIScreen::OnOK); -#endif + if (System_GetPropertyBool(SYSPROP_OK_BUTTON_LEFT)) { + defaultButton_ = buttonRow->Add(new Button(button1_, new LinearLayoutParams(1.0f, buttonMargins))); + defaultButton_->OnClick.Handle(this, &UIScreen::OnOK); + if (!button2_.empty()) + buttonRow->Add(new Button(button2_, new LinearLayoutParams(1.0f, buttonMargins)))->OnClick.Handle(this, &UIScreen::OnCancel); + } else { + if (!button2_.empty()) + buttonRow->Add(new Button(button2_, new LinearLayoutParams(1.0f)))->OnClick.Handle(this, &UIScreen::OnCancel); + defaultButton_ = buttonRow->Add(new Button(button1_, new LinearLayoutParams(1.0f))); + defaultButton_->OnClick.Handle(this, &UIScreen::OnOK); + } box_->Add(buttonRow); } diff --git a/UWP/PPSSPP_UWPMain.cpp b/UWP/PPSSPP_UWPMain.cpp index 52e1b37aca..b3a9ff0a4b 100644 --- a/UWP/PPSSPP_UWPMain.cpp +++ b/UWP/PPSSPP_UWPMain.cpp @@ -435,6 +435,8 @@ bool System_GetPropertyBool(SystemProperty prop) { } case SYSPROP_DEBUGGER_PRESENT: return IsDebuggerPresent(); + case SYSPROP_OK_BUTTON_LEFT: + return true; default: return false; } diff --git a/Windows/main.cpp b/Windows/main.cpp index 762d5a747e..05dd0b6018 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -383,6 +383,8 @@ bool System_GetPropertyBool(SystemProperty prop) { return !g_Config.bDisableHTTPS; case SYSPROP_DEBUGGER_PRESENT: return IsDebuggerPresent(); + case SYSPROP_OK_BUTTON_LEFT: + return true; default: return false; }