X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=mainwindow.cpp;h=5cd698e39cc65346ea06321da3ebe1cdfb56d827;hb=90499af3e3372016f8c34e1f2facdefa0277bf4a;hp=77daf078b0000e643e2b7a5c2bc2aa0e931bed8a;hpb=64ecf5ca155de13a76edaaefc6c4fd1f8e8f92f7;p=nageru diff --git a/mainwindow.cpp b/mainwindow.cpp index 77daf07..5cd698e 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -110,6 +110,9 @@ void MainWindow::mixer_created(Mixer *mixer) connect(ui->locut_cutoff_knob, &QDial::valueChanged, this, &MainWindow::cutoff_knob_changed); cutoff_knob_changed(ui->locut_cutoff_knob->value()); + connect(ui->locut_enabled, &QCheckBox::stateChanged, [this](int state){ + global_mixer->set_locut_enabled(state == Qt::Checked); + }); // Not QDial::valueChanged, as we call setValue() all the time. connect(ui->gainstaging_knob, &QAbstractSlider::sliderMoved, this, &MainWindow::gain_staging_knob_changed); @@ -277,8 +280,9 @@ void MainWindow::relayout() remaining_height -= audiostrip_height + ui->vertical_layout->spacing(); // The previews will be constrained by the remaining height, and the width. - double preview_label_height = previews[0]->title_bar->geometry().height() + ui->preview_displays->spacing(); // Wrong spacing? - int preview_total_width = ui->preview_displays->geometry().width(); + double preview_label_height = previews[0]->title_bar->geometry().height() + + previews[0]->main_vertical_layout->spacing(); + int preview_total_width = ui->preview_displays->geometry().width() - (previews.size() - 1) * ui->preview_displays->spacing(); double preview_height = min(remaining_height - preview_label_height, (preview_total_width / double(previews.size())) * 9.0 / 16.0); remaining_height -= preview_height + preview_label_height + ui->vertical_layout->spacing(); @@ -289,14 +293,12 @@ void MainWindow::relayout() // Set the widths for the previews. double preview_width = preview_height * 16.0 / 9.0; - double remaining_preview_width = preview_total_width; - for (unsigned i = 0; i < previews.size(); ++i) { ui->preview_displays->setStretch(i, lrintf(preview_width)); - remaining_preview_width -= preview_width + ui->preview_displays->spacing(); } // The preview horizontal spacer. + double remaining_preview_width = preview_total_width - previews.size() * preview_width; ui->preview_displays->setStretch(previews.size(), lrintf(remaining_preview_width)); }