diff options
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r-- | src/mainwindow.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2d09504..f70f0be 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -6,6 +6,9 @@ #include <PulseAudioQt/Card> #include <PulseAudioQt/Profile> +#include <QShowEvent> +#include <QDesktopWidget> + MainWindow::MainWindow() : QDialog() { setupUi(this); @@ -24,6 +27,16 @@ MainWindow::~MainWindow() } +void MainWindow::showEvent(QShowEvent *) +{ + int height = qApp->desktop()->size().height(); + int off = height / 12; + if (off < 70) { + off = 70; + } + this->sac->setMaximumHeight(height - off); +} + SlxOutput* MainWindow::getDevice(const PulseAudioQt::Card *card, const PulseAudioQt::Device *device, const PulseAudioQt::Port *port, bool output) { PulseAudioQt::Profile *profile = nullptr; @@ -34,7 +47,7 @@ SlxOutput* MainWindow::getDevice(const PulseAudioQt::Card *card, const PulseAudi if (card != nullptr) { cardId = card->name(); - if (card->activeProfileIndex() < card->profiles().size()) { + if ((int)card->activeProfileIndex() < card->profiles().size()) { profile = card->profiles().at(card->activeProfileIndex()); heading.append(QLatin1String(" (")).append(profile->description()).append(QLatin1String(")")); } @@ -82,7 +95,7 @@ SlxOutput* MainWindow::getCardPort(const PulseAudioQt::Card *card, const PulseAu return w; } -void MainWindow::insertItemWidget(SlxOutput* w, bool isDevice) +void MainWindow::insertItemWidget(SlxOutput* w, bool) { bool done = false; int idx; |