From 6df3cf635a68890c8c9fea1de411c994c9000e73 Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Sun, 16 Jul 2023 19:01:59 +0200 Subject: [PATCH] Center align time based controls Align time based controls, i.e. knobs, in the center. The implementation defeats the purpose of the widget factory a bit but it makes the design look nicer. --- plugins/LadspaEffect/LadspaMatrixControlDialog.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/LadspaEffect/LadspaMatrixControlDialog.cpp b/plugins/LadspaEffect/LadspaMatrixControlDialog.cpp index eb86df941..bcb48009d 100644 --- a/plugins/LadspaEffect/LadspaMatrixControlDialog.cpp +++ b/plugins/LadspaEffect/LadspaMatrixControlDialog.cpp @@ -166,7 +166,11 @@ void LadspaMatrixControlDialog::arrangeControls(QWidget * parent, QGridLayout* g QWidget * controlWidget = LadspaWidgetFactory::createWidget(ladspaControl, this); if (controlWidget) { - gridLayout->addWidget(controlWidget, currentRow, currentChannelColumn); + // Align time based controls, i.e. knobs, in the center. + // This defeats the purpose of the widget factory a bit but it makes the design look nicer. + auto alignment = ladspaControl->port()->data_type == TIME ? Qt::AlignCenter : Qt::Alignment(); + + gridLayout->addWidget(controlWidget, currentRow, currentChannelColumn, alignment); } // Record the maximum row so that we add a vertical spacer after that row