overlay_dialog: Add an overlay text dialog that accepts controller input

An OverlayDialog is an interactive dialog that accepts controller input (while a game is running)
This dialog attempts to replicate the look and feel of the Nintendo Switch's overlay dialogs and
provide some extra features such as embedding HTML/Rich Text content in a QTextBrowser.
The OverlayDialog provides 2 modes: one to embed regular text into a QLabel and another to embed
HTML/Rich Text content into a QTextBrowser.

Co-authored-by: Its-Rei <kupfel@gmail.com>
This commit is contained in:
Morph 2021-03-20 07:57:31 -04:00
parent 6e85370a0e
commit c170ef2dc2
5 changed files with 768 additions and 1 deletions

View file

@ -101,6 +101,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual
#include "core/perf_stats.h"
#include "core/telemetry_session.h"
#include "input_common/main.h"
#include "util/overlay_dialog.h"
#include "video_core/gpu.h"
#include "video_core/shader_notify.h"
#include "yuzu/about_dialog.h"
@ -2266,7 +2267,10 @@ void GMainWindow::OnExecuteProgram(std::size_t program_index) {
}
void GMainWindow::ErrorDisplayDisplayError(QString body) {
QMessageBox::critical(this, tr("Error Display"), body);
OverlayDialog dialog(render_window, Core::System::GetInstance(), body, QString{}, tr("OK"),
Qt::AlignLeft | Qt::AlignVCenter);
dialog.exec();
emit ErrorDisplayFinished();
}