mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-31 12:31:45 +01:00
Qt: force always on top to fix dialogs appearing behind the game window
This commit is contained in:
parent
bb0609372d
commit
cb5dd1353b
@ -241,7 +241,7 @@ void gui_settings::SetCategoryVisibility(int cat, const bool& val)
|
||||
SetValue(value, val);
|
||||
}
|
||||
|
||||
void gui_settings::ShowBox(bool confirm, const QString& title, const QString& text, const gui_save& entry, int* result = nullptr, QWidget* parent = nullptr)
|
||||
void gui_settings::ShowBox(bool confirm, const QString& title, const QString& text, const gui_save& entry, int* result = nullptr, QWidget* parent = nullptr, bool always_on_top = false)
|
||||
{
|
||||
const std::string dialog_type = confirm ? "Confirmation" : "Info";
|
||||
|
||||
@ -250,7 +250,7 @@ void gui_settings::ShowBox(bool confirm, const QString& title, const QString& te
|
||||
const QFlags<QMessageBox::StandardButton> buttons = confirm ? QMessageBox::Yes | QMessageBox::No : QMessageBox::Ok;
|
||||
const QMessageBox::Icon icon = confirm ? QMessageBox::Question : QMessageBox::Information;
|
||||
|
||||
QMessageBox* mb = new QMessageBox(icon, title, text, buttons, parent);
|
||||
QMessageBox* mb = new QMessageBox(icon, title, text, buttons, parent, Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint | (always_on_top ? Qt::WindowStaysOnTopHint : Qt::Widget));
|
||||
mb->deleteLater();
|
||||
|
||||
if (!entry.name.isEmpty())
|
||||
@ -278,12 +278,12 @@ void gui_settings::ShowBox(bool confirm, const QString& title, const QString& te
|
||||
|
||||
void gui_settings::ShowConfirmationBox(const QString& title, const QString& text, const gui_save& entry, int* result = nullptr, QWidget* parent = nullptr)
|
||||
{
|
||||
ShowBox(true, title, text, entry, result, parent);
|
||||
ShowBox(true, title, text, entry, result, parent, true);
|
||||
}
|
||||
|
||||
void gui_settings::ShowInfoBox(const QString& title, const QString& text, const gui_save& entry, QWidget* parent = nullptr)
|
||||
{
|
||||
ShowBox(false, title, text, entry, nullptr, parent);
|
||||
ShowBox(false, title, text, entry, nullptr, parent, false);
|
||||
}
|
||||
|
||||
void gui_settings::SetGamelistColVisibility(int col, bool val)
|
||||
|
@ -289,7 +289,7 @@ public Q_SLOTS:
|
||||
private:
|
||||
QString ComputeSettingsDir();
|
||||
void BackupSettingsToTarget(const QString& friendly_name);
|
||||
void ShowBox(bool confirm, const QString& title, const QString& text, const gui_save& entry, int* result, QWidget* parent);
|
||||
void ShowBox(bool confirm, const QString& title, const QString& text, const gui_save& entry, int* result, QWidget* parent, bool always_on_top);
|
||||
|
||||
QSettings m_settings;
|
||||
QDir m_settingsDir;
|
||||
|
Loading…
x
Reference in New Issue
Block a user