diff --git a/src/blackgui/components/configurationwizard.cpp b/src/blackgui/components/configurationwizard.cpp index 873d37165..e2f22e9be 100644 --- a/src/blackgui/components/configurationwizard.cpp +++ b/src/blackgui/components/configurationwizard.cpp @@ -62,6 +62,8 @@ namespace BlackGui if (!sGui || sGui->isShuttingDown()) { return; } sGui->showHelp(this); }); + + this->setScreenGeometry(); } CConfigurationWizard::~CConfigurationWizard() @@ -126,5 +128,23 @@ namespace BlackGui if (CMathUtils::epsilonEqual(parent->windowOpacity(), opacity)) { return; } parent->setWindowOpacity(opacity); } + + void CConfigurationWizard::setScreenGeometry() + { + if (!sGui) { return; } + const QRect g = CGuiApplication::currentScreenGeometry(); + + // 1280/720 on 4k hires + // 1920/1280 on non hires 1920 displays + const int gw = g.width(); + const int gh = g.height(); + const int calcW = qRound(gw * 0.8); + const int calcH = qRound(gh * 0.9); // normally critical as buttons are hidden + + // do not get too huge + const int w = qMin(900, calcW); + const int h = qMin(750, calcH); + this->resize(w, h); + } } // ns } // ns diff --git a/src/blackgui/components/configurationwizard.h b/src/blackgui/components/configurationwizard.h index 90d931331..734a92b69 100644 --- a/src/blackgui/components/configurationwizard.h +++ b/src/blackgui/components/configurationwizard.h @@ -71,6 +71,9 @@ namespace BlackGui //! Set the parent's window opacity void setParentOpacity(qreal opacity); + //! Set screen geometry based on screen resolution + void setScreenGeometry(); + QScopedPointer ui; int m_previousId = -1; int m_minId = -1;