|
|
@ -112,14 +112,19 @@ class ParamControl : public ToggleControl { |
|
|
|
|
|
|
|
|
|
|
|
public: |
|
|
|
public: |
|
|
|
ParamControl(const QString ¶m, const QString &title, const QString &desc, const QString &icon, QWidget *parent = nullptr) : ToggleControl(title, desc, icon, false, parent) { |
|
|
|
ParamControl(const QString ¶m, const QString &title, const QString &desc, const QString &icon, QWidget *parent = nullptr) : ToggleControl(title, desc, icon, false, parent) { |
|
|
|
if (params.getBool(param.toStdString().c_str())) { |
|
|
|
key = param.toStdString(); |
|
|
|
toggle.togglePosition(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
QObject::connect(this, &ToggleControl::toggleFlipped, [=](bool state) { |
|
|
|
QObject::connect(this, &ToggleControl::toggleFlipped, [=](bool state) { |
|
|
|
params.putBool(param.toStdString().c_str(), state); |
|
|
|
params.putBool(key, state); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void showEvent(QShowEvent *event) override { |
|
|
|
|
|
|
|
if (params.getBool(key) != toggle.on) { |
|
|
|
|
|
|
|
toggle.togglePosition(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
|
|
|
|
std::string key; |
|
|
|
Params params; |
|
|
|
Params params; |
|
|
|
}; |
|
|
|
}; |
|
|
|