summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mainwindow.cpp8
-rw-r--r--src/mainwindow.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 83b999e..2d09504 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -16,6 +16,7 @@ MainWindow::MainWindow() : QDialog()
inputLabel->setFont(f);
outputLabel->setFont(f);
cardLabel->setFont(f);
+ _originalSize = this->size();
}
MainWindow::~MainWindow()
@@ -122,6 +123,9 @@ void MainWindow::insertItemWidget(SlxOutput* w, bool isDevice)
void MainWindow::mark()
{
setUpdatesEnabled(false);
+ this->resize(_originalSize);
+ outputLabel->setMinimumWidth(0);
+ inputLabel->setMinimumWidth(0);
for (auto *w : _widgets) {
w->unused = true;
}
@@ -142,4 +146,8 @@ void MainWindow::sweep()
}
}
setUpdatesEnabled(true);
+ int width = qMax(outputLabel->width(), inputLabel->width());
+ this->resize(_originalSize);
+ outputLabel->setMinimumWidth(width);
+ inputLabel->setMinimumWidth(width);
}
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 5eede3f..cd9f5cb 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -3,6 +3,7 @@
#include <QDialog>
#include <QMap>
+#include <QSize>
#include "ui_mainwindow.h"
@@ -33,6 +34,7 @@ public:
private:
QMap<QString, SlxOutput*> _widgets;
+ QSize _originalSize;
};
#endif