screen too small fix again

This commit is contained in:
MUSIC 2024-07-26 14:48:20 -05:00
parent 779c4a87c9
commit f7a7dff2a3
4 changed files with 21 additions and 11 deletions

View File

@ -40,13 +40,15 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer ** digi, unsigned int nDigi, QStr
enableSignalSlot = false; enableSignalSlot = false;
setWindowTitle("Digitizer Settings"); setWindowTitle("Digitizer Settings");
setGeometry(0, 0, 1700, 850);
//====== resize window if screen too small //====== resize window if screen too small
QScreen * screen = QGuiApplication::primaryScreen(); QScreen * screen = QGuiApplication::primaryScreen();
QRect screenGeo = screen->geometry(); QRect screenGeo = screen->geometry();
if( screenGeo.width() < 1700 || screenGeo.height() < 850) this->showMaximized(); if( screenGeo.width() < 1700 || screenGeo.height() < 850) {
setGeometry(0, 0, screenGeo.width() - 100, screenGeo.height() - 100);
}else{
setGeometry(0, 0, 1700, 850);
}
tabWidget = new QTabWidget(this); tabWidget = new QTabWidget(this);
setCentralWidget(tabWidget); setCentralWidget(tabWidget);

View File

@ -54,13 +54,16 @@ Scope::Scope(Digitizer ** digi, unsigned int nDigi, ReadDataThread ** readDataTh
this->readDataThread = readDataThread; this->readDataThread = readDataThread;
setWindowTitle("Scope"); setWindowTitle("Scope");
setGeometry(0, 0, 1000, 800);
setWindowFlags( this->windowFlags() & ~Qt::WindowCloseButtonHint ); setWindowFlags( this->windowFlags() & ~Qt::WindowCloseButtonHint );
//====== resize window if screen too small //====== resize window if screen too small
QScreen * screen = QGuiApplication::primaryScreen(); QScreen * screen = QGuiApplication::primaryScreen();
QRect screenGeo = screen->geometry(); QRect screenGeo = screen->geometry();
if( screenGeo.width() < 1000 || screenGeo.height() < 800) this->showMaximized(); if( screenGeo.width() < 1000 || screenGeo.height() < 800) {
setGeometry(0, 0, screenGeo.width() - 100, screenGeo.height() - 100);
}else{
setGeometry(0, 0, 1000, 800);
}
enableSignalSlot = false; enableSignalSlot = false;

View File

@ -18,13 +18,17 @@ SingleSpectra::SingleSpectra(Digitizer ** digi, unsigned int nDigi, QString rawD
isSignalSlotActive = true; isSignalSlotActive = true;
setWindowTitle("Single Histograms"); setWindowTitle("Single Histograms");
setGeometry(0, 0, 1000, 800);
//setWindowFlags( this->windowFlags() & ~Qt::WindowCloseButtonHint ); //setWindowFlags( this->windowFlags() & ~Qt::WindowCloseButtonHint );
//====== resize window if screen too small //====== resize window if screen too small
QScreen * screen = QGuiApplication::primaryScreen(); QScreen * screen = QGuiApplication::primaryScreen();
QRect screenGeo = screen->geometry(); QRect screenGeo = screen->geometry();
if( screenGeo.width() < 1000 || screenGeo.height() < 800) this->showMaximized(); if( screenGeo.width() < 1000 || screenGeo.height() < 800) {
setGeometry(0, 0, screenGeo.width() - 100, screenGeo.height() - 100);
}else{
setGeometry(0, 0, 1000, 800);
}
QWidget * layoutWidget = new QWidget(this); QWidget * layoutWidget = new QWidget(this);
setCentralWidget(layoutWidget); setCentralWidget(layoutWidget);

View File

@ -84,13 +84,14 @@ private:
inline void Encore::SetUpCanvas(){ inline void Encore::SetUpCanvas(){
setGeometry(0, 0, 1600, 1600);
//====== resize window if screen too small //====== resize window if screen too small
QScreen * screen = QGuiApplication::primaryScreen(); QScreen * screen = QGuiApplication::primaryScreen();
QRect screenGeo = screen->geometry(); QRect screenGeo = screen->geometry();
if( screenGeo.width() < 1600 || screenGeo.height() < 1600) this->showMaximized(); if( screenGeo.width() < 1600 || screenGeo.height() < 1600) {
setGeometry(0, 0, screenGeo.width() - 100, screenGeo.height() -100);
}else{
setGeometry(0, 0, 1600, 1600);
}
chkRunAnalyzer = new QCheckBox("Run Analyzer", this); chkRunAnalyzer = new QCheckBox("Run Analyzer", this);
layout->addWidget(chkRunAnalyzer, 0, 0); layout->addWidget(chkRunAnalyzer, 0, 0);