Use current screen, not primary screen
This commit is contained in:
parent
66e5ccb9cc
commit
aa255aa7e6
|
@ -24,6 +24,7 @@
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#include <QScreen>
|
#include <QScreen>
|
||||||
|
#include <QWindow>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
@ -283,8 +284,12 @@ void AlbumCoverChoiceController::ShowCover(const Song &song, const QPixmap &pixm
|
||||||
title_text += " (" + QString::number(label->pixmap()->width()) + "x" + QString::number(label->pixmap()->height()) + "px)";
|
title_text += " (" + QString::number(label->pixmap()->width()) + "x" + QString::number(label->pixmap()->height()) + "px)";
|
||||||
|
|
||||||
// If the cover is larger than the screen, resize the window 85% seems to be enough to account for title bar and taskbar etc.
|
// If the cover is larger than the screen, resize the window 85% seems to be enough to account for title bar and taskbar etc.
|
||||||
QScreen *screen = QGuiApplication::primaryScreen();
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||||
QRect screenGeometry = screen->geometry();
|
QScreen *screen = QWidget::screen();
|
||||||
|
#else
|
||||||
|
QScreen *screen = (window() && window()->windowHandle() ? window()->windowHandle()->screen() : QGuiApplication::primaryScreen());
|
||||||
|
#endif
|
||||||
|
QRect screenGeometry = screen->availableGeometry();
|
||||||
int desktop_height = screenGeometry.height();
|
int desktop_height = screenGeometry.height();
|
||||||
int desktop_width = screenGeometry.width();
|
int desktop_width = screenGeometry.width();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue