Skip to content

Commit

Permalink
vcslider: send feedback for override button (fix #1635)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcallegari committed Nov 12, 2024
1 parent edb4d31 commit 6049716
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions ui/src/customfeedbackdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ void CustomFeedbackDialog::setMonitoringVisibility(bool visible)
{
m_monitorLabel->setVisible(visible);
m_monitorSpin->setVisible(visible);
m_monitorColor->setVisible(visible);
m_monitorChannelCombo->setVisible(visible);
}

Expand Down
10 changes: 10 additions & 0 deletions ui/src/virtualconsole/vcslider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,7 @@ void VCSlider::slotResetButtonClicked()
if (!fader.isNull())
fader->removeAll();
}
updateOverrideFeedback(false);

emit monitorDMXValueChanged(m_monitorValue);
}
Expand Down Expand Up @@ -1370,6 +1371,7 @@ void VCSlider::setSliderValue(uchar value, bool scale, bool external)
{
m_resetButton->setStyleSheet(QString("QToolButton{ background: red; }"));
m_isOverriding = true;
updateOverrideFeedback(true);
}
setLevelValue(val, external);
setClickAndGoWidgetFromLevel(val);
Expand Down Expand Up @@ -1510,6 +1512,13 @@ void VCSlider::updateFeedback()
sendFeedback(fbv);
}

void VCSlider::updateOverrideFeedback(bool on)
{
QSharedPointer<QLCInputSource> src = inputSource(overrideResetInputSourceId);
if (!src.isNull() && src->isValid() == true)
sendFeedback(src->feedbackValue(on ? QLCInputFeedback::UpperValue : QLCInputFeedback::LowerValue), overrideResetInputSourceId);
}

void VCSlider::slotSliderMoved(int value)
{
/* Set text for the top label */
Expand Down Expand Up @@ -1574,6 +1583,7 @@ void VCSlider::slotInputValueChanged(quint32 universe, quint32 channel, uchar va
{
m_resetButton->setStyleSheet(QString("QToolButton{ background: red; }"));
m_isOverriding = true;
updateOverrideFeedback(true);
}

if (invertedAppearance())
Expand Down
2 changes: 2 additions & 0 deletions ui/src/virtualconsole/vcslider.h
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,8 @@ protected slots:

void updateFeedback();

void updateOverrideFeedback(bool on);

signals:
void requestSliderUpdate(int value);
void valueChanged(QString val);
Expand Down

0 comments on commit 6049716

Please sign in to comment.