diff options
author | Simon Rettberg | 2023-03-07 14:22:47 +0100 |
---|---|---|
committer | Simon Rettberg | 2023-03-07 14:22:47 +0100 |
commit | 02943c52af87115bb70745fca852a02c0df9b016 (patch) | |
tree | 201406beed10d9999bcc927e7a1c0ef7b80cf6c3 /src | |
parent | Tweak window layout, vertical scrollbar as needed (diff) | |
download | pavucontrol-slx-02943c52af87115bb70745fca852a02c0df9b016.tar.gz pavucontrol-slx-02943c52af87115bb70745fca852a02c0df9b016.tar.xz pavucontrol-slx-02943c52af87115bb70745fca852a02c0df9b016.zip |
Revert "Tweak window layout, vertical scrollbar as needed"
This reverts commit c13ecf1e2527236101492c160a5d7d4e380314a3.
Doesn't work, fuck Qt layout crap.
Diffstat (limited to 'src')
-rw-r--r-- | src/mainwindow.cpp | 17 | ||||
-rw-r--r-- | src/mainwindow.h | 4 | ||||
-rw-r--r-- | 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 <PulseAudioQt/Card> #include <PulseAudioQt/Profile> -#include <QShowEvent> -#include <QDesktopWidget> - 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<QString, SlxOutput*> _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 @@ <rect> <x>0</x> <y>0</y> - <width>656</width> - <height>308</height> + <width>587</width> + <height>300</height> </rect> </property> <property name="windowTitle"> @@ -15,112 +15,98 @@ </property> <layout class="QVBoxLayout" name="verticalLayout"> <item> - <widget class="QScrollArea" name="scrollArea"> - <property name="horizontalScrollBarPolicy"> - <enum>Qt::ScrollBarAlwaysOff</enum> - </property> - <property name="widgetResizable"> - <bool>true</bool> - </property> - <widget class="QWidget" name="sac"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>636</width> - <height>288</height> - </rect> - </property> - <layout class="QVBoxLayout" name="verticalLayout_4"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <layout class="QVBoxLayout" name="verticalLayout_3"> <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <layout class="QVBoxLayout" name="verticalLayout_3"> - <item> - <widget class="QLabel" name="outputLabel"> - <property name="font"> - <font> - <bold>true</bold> - </font> - </property> - <property name="text"> - <string>Output</string> - </property> - </widget> - </item> - <item> - <layout class="QVBoxLayout" name="outputListLayout"/> - </item> - <item> - <spacer name="verticalSpacer_3"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <widget class="QLabel" name="inputLabel"> - <property name="font"> - <font> - <bold>true</bold> - </font> - </property> - <property name="text"> - <string>Input</string> - </property> - </widget> - </item> - <item> - <layout class="QVBoxLayout" name="inputListLayout"/> - </item> - <item> - <spacer name="verticalSpacer_2"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - </layout> + <widget class="QLabel" name="outputLabel"> + <property name="font"> + <font> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>Output</string> + </property> + </widget> </item> <item> - <widget class="Line" name="line"> + <layout class="QVBoxLayout" name="outputListLayout"/> + </item> + <item> + <spacer name="verticalSpacer_3"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Vertical</enum> </property> - </widget> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> </item> + </layout> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_2"> <item> - <widget class="QLabel" name="cardLabel"> + <widget class="QLabel" name="inputLabel"> + <property name="font"> + <font> + <weight>75</weight> + <bold>true</bold> + </font> + </property> <property name="text"> - <string>Card/Profile</string> + <string>Input</string> </property> </widget> </item> <item> - <layout class="QVBoxLayout" name="cards"/> + <layout class="QVBoxLayout" name="inputListLayout"/> + </item> + <item> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> </item> </layout> - </widget> + </item> + </layout> + </item> + <item> + <widget class="QLabel" name="cardLabel"> + <property name="text"> + <string>Card/Profile</string> + </property> </widget> </item> + <item> + <layout class="QVBoxLayout" name="cards"/> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> </layout> </widget> <resources/> |