]> sigrok.org Git - pulseview.git/commitdiff
Connect dialog: Let the device list occupy only the minimum space needed
authorSoeren Apel <redacted>
Tue, 3 Jul 2018 16:24:40 +0000 (18:24 +0200)
committerUwe Hermann <redacted>
Sat, 21 Jul 2018 16:57:21 +0000 (18:57 +0200)
pv/dialogs/connect.cpp

index 911956af73fab4b856e8c09a1b57421439e3cc12..29d5b0269a05d23777d1a78cccdb38067a2d045b 100644 (file)
@@ -102,6 +102,9 @@ Connect::Connect(QWidget *parent, pv::DeviceManager &device_manager) :
        tcp_config_layout->setContentsMargins(0, 0, 0, 0);
        tcp_config_->setEnabled(false);
 
+       // Let the device list occupy only the minimum space needed
+       device_list_.setMaximumHeight(device_list_.minimumSizeHint().height());
+
        QVBoxLayout *vbox_if = new QVBoxLayout;
        vbox_if->addWidget(radiobtn_usb);
        vbox_if->addWidget(radiobtn_serial);
@@ -243,13 +246,10 @@ void Connect::scan_pressed()
        for (shared_ptr<HardwareDevice> device : devices) {
                assert(device);
 
-               QString text = QString::fromStdString(
-                       device->display_name(device_manager_));
-               text += QString(" with %1 channels").arg(
-                       device->device()->channels().size());
+               QString text = QString::fromStdString(device->display_name(device_manager_));
+               text += QString(" with %1 channels").arg(device->device()->channels().size());
 
-               QListWidgetItem *const item = new QListWidgetItem(text,
-                       &device_list_);
+               QListWidgetItem *const item = new QListWidgetItem(text, &device_list_);
                item->setData(Qt::UserRole, qVariantFromValue(device));
                device_list_.addItem(item);
        }