Skip to content

Commit

Permalink
Renamed lMaxColumns, lCurColumn and lCurRow to m_maxColumns, …
Browse files Browse the repository at this point in the history
…`m_curColumn` and `m_curRow`.
  • Loading branch information
CYBERDEViLNL committed Oct 9, 2019
1 parent 1686f03 commit 5d06520
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
31 changes: 15 additions & 16 deletions plugins/carlabase/carla.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,12 +673,11 @@ void CarlaInstrumentView::paramsUiClosed()

CarlaParamsView::CarlaParamsView(CarlaInstrument* const instrument, QWidget* const parent)
: InstrumentView(instrument, parent),
m_carlaInstrument(instrument)
m_carlaInstrument(instrument),
m_maxColumns(6),
m_curColumn(0),
m_curRow(0)
{
lMaxColumns = 6;
lCurColumn = 0;
lCurRow = 0;

// Create central widget
/* ___ centralWidget _______________ QWidget
* | __ verticalLayout _____________ QVBoxLayout
Expand Down Expand Up @@ -770,7 +769,7 @@ CarlaParamsView::CarlaParamsView(CarlaInstrument* const instrument, QWidget* con
m_scrollAreaLayout->setContentsMargins(3, 3, 3, 3);
m_scrollAreaLayout->setVerticalSpacing(12);
m_scrollAreaLayout->setHorizontalSpacing(6);
m_scrollAreaLayout->setColumnStretch(lMaxColumns, 1);
m_scrollAreaLayout->setColumnStretch(m_maxColumns, 1);


// Add m_toolBarLayout and m_scrollArea to the verticalLayout.
Expand Down Expand Up @@ -898,8 +897,8 @@ void CarlaParamsView::refreshKnobs()
}

// Reset position data.
lCurColumn = 0;
lCurRow = 0;
m_curColumn = 0;
m_curRow = 0;

if (!m_carlaInstrument->m_paramModels.count()) { return; }

Expand All @@ -923,24 +922,24 @@ void CarlaParamsView::refreshKnobs()

// Add spacer so all knobs go to top
QSpacerItem* verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
m_scrollAreaLayout->addItem(verticalSpacer, lCurRow+1, 0, 1, 1);
m_scrollAreaLayout->addItem(verticalSpacer, m_curRow + 1, 0, 1, 1);
}

void CarlaParamsView::addKnob(uint32_t index)
{
// Add the new knob to layout
m_scrollAreaLayout->addWidget(m_knobs[index], lCurRow, lCurColumn, Qt::AlignHCenter | Qt::AlignTop);
m_scrollAreaLayout->addWidget(m_knobs[index], m_curRow, m_curColumn, Qt::AlignHCenter | Qt::AlignTop);

// Chances that we did close() on the widget is big, so show it.
m_knobs[index]->show();

// Keep track of current column and row index.
if (lCurColumn < lMaxColumns-1)
if (m_curColumn < m_maxColumns - 1)
{
lCurColumn++;
m_curColumn++;
} else {
lCurColumn=0;
lCurRow++;
m_curColumn = 0;
m_curRow++;
}
}
void CarlaParamsView::clearKnobs()
Expand All @@ -952,8 +951,8 @@ void CarlaParamsView::clearKnobs()
}

// Reset position data.
lCurColumn = 0;
lCurRow = 0;
m_curColumn = 0;
m_curRow = 0;
}

void CarlaParamsView::modelChanged()
Expand Down
6 changes: 3 additions & 3 deletions plugins/carlabase/carla.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ private slots:
CarlaInstrument* const m_carlaInstrument;
QList<Knob*> m_knobs;

uint32_t lMaxColumns;
uint32_t lCurColumn;
uint32_t lCurRow;
const uint32_t m_maxColumns;
uint32_t m_curColumn;
uint32_t m_curRow;

QScrollArea* m_scrollArea;
QGridLayout* m_scrollAreaLayout;
Expand Down

0 comments on commit 5d06520

Please sign in to comment.