From 02943c52af87115bb70745fca852a02c0df9b016 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 7 Mar 2023 14:22:47 +0100 Subject: Revert "Tweak window layout, vertical scrollbar as needed" This reverts commit c13ecf1e2527236101492c160a5d7d4e380314a3. Doesn't work, fuck Qt layout crap. --- src/mainwindow.cpp | 17 +----- src/mainwindow.h | 4 -- src/mainwindow.ui | 170 ++++++++++++++++++++++++----------------------------- 3 files changed, 80 insertions(+), 111 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index f70f0be..2d09504 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -6,9 +6,6 @@ #include #include -#include -#include - MainWindow::MainWindow() : QDialog() { setupUi(this); @@ -27,16 +24,6 @@ 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; @@ -47,7 +34,7 @@ SlxOutput* MainWindow::getDevice(const PulseAudioQt::Card *card, const PulseAudi if (card != nullptr) { cardId = card->name(); - if ((int)card->activeProfileIndex() < card->profiles().size()) { + if (card->activeProfileIndex() < card->profiles().size()) { profile = card->profiles().at(card->activeProfileIndex()); heading.append(QLatin1String(" (")).append(profile->description()).append(QLatin1String(")")); } @@ -95,7 +82,7 @@ SlxOutput* MainWindow::getCardPort(const PulseAudioQt::Card *card, const PulseAu return w; } -void MainWindow::insertItemWidget(SlxOutput* w, bool) +void MainWindow::insertItemWidget(SlxOutput* w, bool isDevice) { bool done = false; int idx; diff --git a/src/mainwindow.h b/src/mainwindow.h index f814d00..cd9f5cb 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -8,7 +8,6 @@ #include "ui_mainwindow.h" class SlxOutput; -class QShowEvent; namespace PulseAudioQt { class Device; class Port; @@ -33,9 +32,6 @@ public: void mark(); void sweep(); -protected: - void showEvent(QShowEvent *ev) override; - private: QMap _widgets; QSize _originalSize; diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 646c26a..03e1aae 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -6,8 +6,8 @@ 0 0 - 656 - 308 + 587 + 300 @@ -15,112 +15,98 @@ - - - Qt::ScrollBarAlwaysOff - - - true - - - - - 0 - 0 - 636 - 288 - - - + + + - - - - - - - - true - - - - Output - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - true - - - - Input - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - + + + + 75 + true + + + + Output + + - + + + + - Qt::Horizontal + Qt::Vertical - + + + 20 + 40 + + + + + + + - + + + + 75 + true + + - Card/Profile + Input - + + + + + + Qt::Vertical + + + + 20 + 40 + + + - + + + + + + + Card/Profile + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + -- cgit v1.2.3-55-g7522