forked from suyu/suyu
qt: use main window as close overlay parent
This commit is contained in:
parent
053ad04d3f
commit
ae6015a69b
2 changed files with 4 additions and 4 deletions
|
@ -1815,9 +1815,8 @@ void GMainWindow::OnShutdownBegin() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GMainWindow::OnShutdownBeginDialog() {
|
void GMainWindow::OnShutdownBeginDialog() {
|
||||||
shutdown_dialog =
|
shutdown_dialog = new OverlayDialog(this, *system, QString{}, tr("Closing software..."),
|
||||||
new OverlayDialog(render_window, *system, QString{}, tr("Closing software..."), QString{},
|
QString{}, QString{}, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
QString{}, Qt::AlignHCenter | Qt::AlignVCenter);
|
|
||||||
shutdown_dialog->open();
|
shutdown_dialog->open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
#include <QScreen>
|
#include <QScreen>
|
||||||
|
#include <QWindow>
|
||||||
|
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
#include "core/hid/hid_types.h"
|
#include "core/hid/hid_types.h"
|
||||||
|
@ -162,7 +163,7 @@ void OverlayDialog::MoveAndResizeWindow() {
|
||||||
const auto height = static_cast<float>(parentWidget()->height());
|
const auto height = static_cast<float>(parentWidget()->height());
|
||||||
|
|
||||||
// High DPI
|
// High DPI
|
||||||
const float dpi_scale = qApp->screenAt(pos)->logicalDotsPerInch() / 96.0f;
|
const float dpi_scale = parentWidget()->windowHandle()->screen()->logicalDotsPerInch() / 96.0f;
|
||||||
|
|
||||||
const auto title_text_font_size = BASE_TITLE_FONT_SIZE * (height / BASE_HEIGHT) / dpi_scale;
|
const auto title_text_font_size = BASE_TITLE_FONT_SIZE * (height / BASE_HEIGHT) / dpi_scale;
|
||||||
const auto body_text_font_size =
|
const auto body_text_font_size =
|
||||||
|
|
Loading…
Reference in a new issue