From 8f682acecac9f47f052a5b4d578a335c746f31ee Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Fri, 2 Sep 2022 13:26:49 +0200 Subject: [PATCH] make sure that the minimum height of musrStep is not larger than the available screen resolution height. --- src/musredit_qt5/musrStep/PMusrStep.cpp | 8 ++++++++ src/musredit_qt6/musrStep/PMusrStep.cpp | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/src/musredit_qt5/musrStep/PMusrStep.cpp b/src/musredit_qt5/musrStep/PMusrStep.cpp index 457394db..249dbe98 100644 --- a/src/musredit_qt5/musrStep/PMusrStep.cpp +++ b/src/musredit_qt5/musrStep/PMusrStep.cpp @@ -39,6 +39,8 @@ #include #include #include +#include +#include #include @@ -175,6 +177,12 @@ PMusrStep::PMusrStep(const char *fln, QWidget *parent) : height = 20*fParamVec.size(); else height = 900; + // make sure that the minimal height is not larger than the screen resolution height + QScreen *screen = QGuiApplication::primaryScreen(); + int hh = screen->geometry().height(); + if (height > hh) + height = hh - 70; + setMinimumSize(400, height); // populate dialog diff --git a/src/musredit_qt6/musrStep/PMusrStep.cpp b/src/musredit_qt6/musrStep/PMusrStep.cpp index cef86072..422dfc72 100644 --- a/src/musredit_qt6/musrStep/PMusrStep.cpp +++ b/src/musredit_qt6/musrStep/PMusrStep.cpp @@ -39,6 +39,8 @@ #include #include #include +#include +#include #include @@ -175,6 +177,11 @@ PMusrStep::PMusrStep(const char *fln, QWidget *parent) : height = 20*fParamVec.size(); else height = 900; + // make sure that the minimal height is not larger than the screen resolution height + QScreen *screen = QGuiApplication::primaryScreen(); + int hh = screen->geometry().height(); + if (height > hh) + height = hh - 70; setMinimumSize(400, height); // populate dialog