ui: Fix NNLC toggle not staying in persistent state (#697)

The `showEvent` method in `NeuralNetworkLateralControl` was removed as it duplicated functionality now handled in `LateralPanel`. The unused `refresh` method was also removed to streamline the code and improve maintainability.
This commit is contained in:
Jason Wen
2025-03-22 11:18:32 -04:00
committed by GitHub
parent c70d3db1e6
commit efb44aeecd
3 changed files with 1 additions and 7 deletions
@@ -13,10 +13,6 @@ NeuralNetworkLateralControl::NeuralNetworkLateralControl() :
updateToggle();
}
void NeuralNetworkLateralControl::showEvent(QShowEvent *event) {
updateToggle();
}
void NeuralNetworkLateralControl::updateToggle() {
QString statusInitText = "<font color='yellow'>" + STATUS_CHECK_COMPATIBILITY + "</font>";
QString notLoadedText = "<font color='yellow'>" + STATUS_NOT_LOADED + "</font>";
@@ -18,7 +18,6 @@ class NeuralNetworkLateralControl : public ParamControl {
public:
NeuralNetworkLateralControl();
void showEvent(QShowEvent *event) override;
public slots:
void updateToggle();
@@ -26,8 +25,6 @@ public slots:
private:
Params params;
void refresh();
// Status messages
const QString STATUS_NOT_AVAILABLE = tr("NNLC is currently not available on this platform.");
const QString STATUS_CHECK_COMPATIBILITY = tr("Start the car to check car compatibility");
@@ -85,6 +85,7 @@ LateralPanel::LateralPanel(SettingsWindowSP *parent) : QFrame(parent) {
}
void LateralPanel::showEvent(QShowEvent *event) {
nnlcToggle->updateToggle();
updateToggles(offroad);
}