Remove extra check for oversized window
This commit is contained in:
parent
5a5f50e1e4
commit
5a3edc00ac
@ -267,21 +267,11 @@ void AlbumCoverManager::LoadGeometry() {
|
|||||||
}
|
}
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
|
||||||
// Resize the window if it's too big
|
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
|
||||||
QScreen *screen = QWidget::screen();
|
|
||||||
#else
|
|
||||||
QScreen *screen = (window() && window()->windowHandle() ? window()->windowHandle()->screen() : QGuiApplication::primaryScreen());
|
|
||||||
#endif
|
|
||||||
if (screen && screen->availableGeometry().height() < height()) {
|
|
||||||
resize(width(), sizeHint().height());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Center the window on the same screen as the mainwindow.
|
// Center the window on the same screen as the mainwindow.
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||||
screen = mainwindow_->screen();
|
QScreen *screen = mainwindow_->screen();
|
||||||
#else
|
#else
|
||||||
screen = (mainwindow_->window() && mainwindow_->window()->windowHandle() ? mainwindow_->window()->windowHandle()->screen() : nullptr);
|
QScreen *screen = (mainwindow_->window() && mainwindow_->window()->windowHandle() ? mainwindow_->window()->windowHandle()->screen() : nullptr);
|
||||||
#endif
|
#endif
|
||||||
if (screen) {
|
if (screen) {
|
||||||
const QRect sr = screen->availableGeometry();
|
const QRect sr = screen->availableGeometry();
|
||||||
|
@ -219,21 +219,11 @@ void SettingsDialog::LoadGeometry() {
|
|||||||
}
|
}
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
|
||||||
// Resize the dialog if it's too big
|
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
|
||||||
QScreen *screen = QWidget::screen();
|
|
||||||
#else
|
|
||||||
QScreen *screen = (window() && window()->windowHandle() ? window()->windowHandle()->screen() : QGuiApplication::primaryScreen());
|
|
||||||
#endif
|
|
||||||
if (screen && screen->availableGeometry().height() < height()) {
|
|
||||||
resize(width(), sizeHint().height());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Center the dialog on the same screen as mainwindow.
|
// Center the dialog on the same screen as mainwindow.
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||||
screen = mainwindow_->screen();
|
QScreen *screen = mainwindow_->screen();
|
||||||
#else
|
#else
|
||||||
screen = (mainwindow_->window() && mainwindow_->window()->windowHandle() ? mainwindow_->window()->windowHandle()->screen() : nullptr);
|
QScreen *screen = (mainwindow_->window() && mainwindow_->window()->windowHandle() ? mainwindow_->window()->windowHandle()->screen() : nullptr);
|
||||||
#endif
|
#endif
|
||||||
if (screen) {
|
if (screen) {
|
||||||
const QRect sr = screen->availableGeometry();
|
const QRect sr = screen->availableGeometry();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user