Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions plugins/LadspaEffect/LadspaMatrixControlDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@
#include "LadspaControlView.h"
#include "LedCheckBox.h"

#include "GuiApplication.h"
#include "MainWindow.h"


namespace lmms::gui
{
Expand Down Expand Up @@ -206,20 +203,6 @@ void LadspaMatrixControlDialog::updateEffectView(LadspaControls * ladspaControls
// From: https://forum.qt.io/topic/13374/solved-qscrollarea-vertical-scroll-only/4
m_scrollArea->setMinimumWidth(matrixWidget->minimumSizeHint().width() + m_scrollArea->verticalScrollBar()->width());


// Make sure that the widget is shown without a scrollbar whenever possible
// If the widget fits on the workspace we use the height of the widget as the minimum size of the scroll area.
// This will ensure that the scrollbar is not shown initially (and never will be).
// If the widget is larger than the workspace then we want it to mostly cover the workspace.
//
// This is somewhat ugly but I have no idea how to control the initial size of the scroll area otherwise
auto const workspaceSize = getGUI()->mainWindow()->workspace()->viewport()->size();
// Make sure that we always account a minumum height for the workspace, i.e. that we never compute
// something close to 0 if the LMMS window is very small
int workspaceHeight = qMax(200, static_cast<int>(workspaceSize.height() * 0.9));
int minOfWidgetAndWorkspace = qMin(matrixWidget->minimumSizeHint().height(), workspaceHeight);
m_scrollArea->setMinimumHeight(minOfWidgetAndWorkspace);

if (getChannelCount() > 1 && m_stereoLink != nullptr)
{
m_stereoLink->setModel(&ladspaControls->m_stereoLinkModel);
Expand Down