make sure that the minimum height of musrStep is not larger than the available screen resolution height.

This commit is contained in:
suter_a 2022-09-02 13:26:49 +02:00
parent d0923d75b9
commit 8f682aceca
2 changed files with 15 additions and 0 deletions

View File

@ -39,6 +39,8 @@
#include <QDoubleValidator> #include <QDoubleValidator>
#include <QTextStream> #include <QTextStream>
#include <QPixmap> #include <QPixmap>
#include <QGuiApplication>
#include <QScreen>
#include <QDebug> #include <QDebug>
@ -175,6 +177,12 @@ PMusrStep::PMusrStep(const char *fln, QWidget *parent) :
height = 20*fParamVec.size(); height = 20*fParamVec.size();
else else
height = 900; 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); setMinimumSize(400, height);
// populate dialog // populate dialog

View File

@ -39,6 +39,8 @@
#include <QDoubleValidator> #include <QDoubleValidator>
#include <QTextStream> #include <QTextStream>
#include <QPixmap> #include <QPixmap>
#include <QGuiApplication>
#include <QScreen>
#include <QDebug> #include <QDebug>
@ -175,6 +177,11 @@ PMusrStep::PMusrStep(const char *fln, QWidget *parent) :
height = 20*fParamVec.size(); height = 20*fParamVec.size();
else else
height = 900; 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); setMinimumSize(400, height);
// populate dialog // populate dialog