|
|
@ -116,13 +116,15 @@ class ParamControl : public ToggleControl { |
|
|
|
Q_OBJECT |
|
|
|
Q_OBJECT |
|
|
|
|
|
|
|
|
|
|
|
public: |
|
|
|
public: |
|
|
|
ParamControl(const QString ¶m, const QString &title, const QString &desc, const QString &icon, QWidget *parent = nullptr) : ToggleControl(title, desc, icon, parent) { |
|
|
|
ParamControl(const QString ¶m, const QString &title, const QString &desc, const QString &icon, QWidget *parent = nullptr) : ToggleControl(title, desc, icon, false, parent) { |
|
|
|
// set initial state from param
|
|
|
|
if (params.getBool(param.toStdString().c_str())) { |
|
|
|
if (Params().getBool(param.toStdString().c_str())) { |
|
|
|
|
|
|
|
toggle.togglePosition(); |
|
|
|
toggle.togglePosition(); |
|
|
|
} |
|
|
|
} |
|
|
|
QObject::connect(this, &ToggleControl::toggleFlipped, [=](int state) { |
|
|
|
QObject::connect(this, &ToggleControl::toggleFlipped, [=](bool state) { |
|
|
|
Params().putBool(param.toStdString().c_str(), (bool)state); |
|
|
|
params.putBool(param.toStdString().c_str(), state); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
|
|
|
Params params; |
|
|
|
}; |
|
|
|
}; |
|
|
|