Avoid adding journal checkpoints when initially creating volume knobs (#8214)

* reimplement getter and setter of FloatModelEditorBase::m_volumeKnob to avoid undo checkpoint creation

* convert FloatModelEditorBase::m_volumeKnob from BoolModel to bool

* clean up

* remove unnecessary inline keywords and fix formatting

---------

Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
This commit is contained in:
Itreza2
2026-01-19 16:53:10 +01:00
committed by GitHub
parent dab06be491
commit f4f85e1f33

View File

@@ -41,7 +41,6 @@ class LMMS_EXPORT FloatModelEditorBase : public QWidget, public FloatModelView
{
Q_OBJECT
mapPropertyFromModel(bool, isVolumeKnob, setVolumeKnob, m_volumeKnob);
mapPropertyFromModel(float, volumeRatio, setVolumeRatio, m_volumeRatio);
void initUi(const QString & name); //!< to be called by ctors
@@ -63,6 +62,16 @@ public:
setUnit(txt_after);
}
bool isVolumeKnob() const
{
return m_volumeKnob;
}
void setVolumeKnob(const bool val)
{
m_volumeKnob = val;
}
signals:
void sliderPressed();
void sliderReleased();
@@ -103,7 +112,7 @@ protected:
static SimpleTextFloat * s_textFloat;
BoolModel m_volumeKnob;
bool m_volumeKnob;
FloatModel m_volumeRatio;
QPoint m_lastMousePos; //!< mouse position in last mouseMoveEvent