From: Steinar H. Gunderson Date: Mon, 18 Jan 2016 21:09:24 +0000 (+0100) Subject: Small tweaks to the layout code. Still not perfect aspect. X-Git-Tag: 1.0.0~6 X-Git-Url: https://git.sesse.net/?p=nageru;a=commitdiff_plain;h=90499af3e3372016f8c34e1f2facdefa0277bf4a Small tweaks to the layout code. Still not perfect aspect. --- diff --git a/mainwindow.cpp b/mainwindow.cpp index 5535c15..5cd698e 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -280,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(); @@ -292,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)); } diff --git a/ui_display.ui b/ui_display.ui index 40c6e43..79be4c2 100644 --- a/ui_display.ui +++ b/ui_display.ui @@ -13,7 +13,7 @@ Form - + 0