Do not use screengeometry

This commit is contained in:
Luis Ángel San Martín 2021-10-07 22:23:54 +02:00
parent 36227a1354
commit ec95f8f5c3

View File

@ -209,8 +209,14 @@ void ComicVineDialog::setComics(const QList<ComicDB> &comics)
QSize ComicVineDialog::sizeHint() const
{
int heightDesktopResolution = QApplication::desktop()->screenGeometry().height();
int widthDesktopResolution = QApplication::desktop()->screenGeometry().width();
QScreen *screen = window()->screen();
if (screen == nullptr) {
screen = QApplication::screens().constFirst();
}
int heightDesktopResolution = screen->geometry().height();
int widthDesktopResolution = screen->geometry().width();
int height, width;
height = qMax(529, static_cast<int>(heightDesktopResolution * 0.5));
width = height * 1.65;