diff --git a/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp b/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp index d17633e2..90bc9e4b 100644 --- a/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp +++ b/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp @@ -209,8 +209,14 @@ void ComicVineDialog::setComics(const QList &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(heightDesktopResolution * 0.5)); width = height * 1.65;