diff options
author | RJ Ryan <rryan@mixxx.org> | 2014-10-29 23:47:34 -0400 |
---|---|---|
committer | RJ Ryan <rryan@mixxx.org> | 2014-10-29 23:47:34 -0400 |
commit | 3468571dd01fec19a89f39729e2004430f837666 (patch) | |
tree | 6c82dc196e945fcb68c48a02d6894fcdf90dadc1 /src/dlgcoverartfullsize.cpp | |
parent | fa683d891d11d46117e81a7ed4f08b9e0b9c97c7 (diff) |
Revert DlgTrackInfo parentage change.
In DlgCoverArtFullSize, max across all top level windows to get the
appropriate size for the cover art. Maybe this fixes the original issue?
Diffstat (limited to 'src/dlgcoverartfullsize.cpp')
-rw-r--r-- | src/dlgcoverartfullsize.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/dlgcoverartfullsize.cpp b/src/dlgcoverartfullsize.cpp index c0baed5bc6..5cfe03dd9c 100644 --- a/src/dlgcoverartfullsize.cpp +++ b/src/dlgcoverartfullsize.cpp @@ -13,12 +13,6 @@ DlgCoverArtFullSize::~DlgCoverArtFullSize() { } void DlgCoverArtFullSize::init(CoverInfo info) { - // this cannot be null - QWidget* activeWindow = QApplication::activeWindow(); - if (activeWindow == NULL) { - return; - } - // TODO(rryan): don't do this in the main thread QImage cover = CoverArtUtils::loadCover(info); QPixmap pixmap; @@ -30,10 +24,16 @@ void DlgCoverArtFullSize::init(CoverInfo info) { return; } + QWidgetList windows = QApplication::topLevelWidgets(); + QSize largestWindowSize; + foreach (QWidget* pWidget, windows) { + largestWindowSize = largestWindowSize.expandedTo(pWidget->size()); + } + // If cover is bigger than Mixxx, it must be resized! // In this case, it need to do a small adjust to make // this dlg a bit smaller than the Mixxx window. - QSize mixxxSize = activeWindow->size() / qreal(1.2); + QSize mixxxSize = largestWindowSize / qreal(1.2); if (pixmap.height() > mixxxSize.height() || pixmap.width() > mixxxSize.width()) { pixmap = pixmap.scaled( |