From 190ded7f485695870aadd391591da93c6cf01af0 Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Sun, 18 Dec 2022 23:54:56 -0500 Subject: [PATCH 1/2] overlay_dialog: Hide button dialog box when both buttons are hidden This allows for the creation of a non-interactive dialog overlay to display system messages. --- src/yuzu/util/overlay_dialog.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/yuzu/util/overlay_dialog.cpp b/src/yuzu/util/overlay_dialog.cpp index b27954512..e6ca8dc3b 100644 --- a/src/yuzu/util/overlay_dialog.cpp +++ b/src/yuzu/util/overlay_dialog.cpp @@ -83,6 +83,10 @@ void OverlayDialog::InitializeRegularTextDialog(const QString& title_text, const ui->button_ok_label->setEnabled(false); } + if (ui->button_cancel->isHidden() && ui->button_ok_label->isHidden()) { + ui->buttonsDialog->hide(); + } + connect( ui->button_cancel, &QPushButton::clicked, this, [this](bool) { @@ -130,6 +134,10 @@ void OverlayDialog::InitializeRichTextDialog(const QString& title_text, const QS ui->button_ok_rich->setEnabled(false); } + if (ui->button_cancel_rich->isHidden() && ui->button_ok_rich->isHidden()) { + ui->buttonsRichDialog->hide(); + } + connect( ui->button_cancel_rich, &QPushButton::clicked, this, [this](bool) { From 690a4c94382f76d39ce2bba4b3ed4c83e9c03050 Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Mon, 19 Dec 2022 00:00:03 -0500 Subject: [PATCH 2/2] overlay_dialog: Avoid starting the input thread if non-interactive --- src/yuzu/util/overlay_dialog.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/yuzu/util/overlay_dialog.cpp b/src/yuzu/util/overlay_dialog.cpp index e6ca8dc3b..3fa3d0afb 100644 --- a/src/yuzu/util/overlay_dialog.cpp +++ b/src/yuzu/util/overlay_dialog.cpp @@ -42,7 +42,7 @@ OverlayDialog::OverlayDialog(QWidget* parent, Core::System& system, const QStrin MoveAndResizeWindow(); // TODO (Morph): Remove this when InputInterpreter no longer relies on the HID backend - if (system.IsPoweredOn()) { + if (system.IsPoweredOn() && !ui->buttonsDialog->isHidden()) { input_interpreter = std::make_unique(system); StartInputThread(); @@ -85,6 +85,7 @@ void OverlayDialog::InitializeRegularTextDialog(const QString& title_text, const if (ui->button_cancel->isHidden() && ui->button_ok_label->isHidden()) { ui->buttonsDialog->hide(); + return; } connect( @@ -136,6 +137,7 @@ void OverlayDialog::InitializeRichTextDialog(const QString& title_text, const QS if (ui->button_cancel_rich->isHidden() && ui->button_ok_rich->isHidden()) { ui->buttonsRichDialog->hide(); + return; } connect(