diff options
author | Simon Rettberg | 2022-09-14 10:14:29 +0200 |
---|---|---|
committer | Simon Rettberg | 2022-09-14 10:14:29 +0200 |
commit | 3f128e6555ca2605d29ab7d0868b2f5c3bdf968d (patch) | |
tree | 55c14c405adfaec3caaa8682f9271fe0b967ef56 /src | |
parent | TabView -> two colums [Output, Input] (diff) | |
download | pavucontrol-slx-3f128e6555ca2605d29ab7d0868b2f5c3bdf968d.tar.gz pavucontrol-slx-3f128e6555ca2605d29ab7d0868b2f5c3bdf968d.tar.xz pavucontrol-slx-3f128e6555ca2605d29ab7d0868b2f5c3bdf968d.zip |
Make resizing a little less bad
Diffstat (limited to 'src')
-rw-r--r-- | src/mainwindow.cpp | 8 | ||||
-rw-r--r-- | src/mainwindow.h | 2 |
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 |