diff --git a/selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot_panel.cc b/selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot_panel.cc index fc9d212ae5..6a09a5426f 100644 --- a/selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot_panel.cc +++ b/selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot_panel.cc @@ -28,23 +28,20 @@ SunnypilotPanel::SunnypilotPanel(SettingsWindowSP *parent) : QFrame(parent) { SubPanelButton *madsSettingsButton = new SubPanelButton(tr("Customize MADS")); madsSettingsButton->setObjectName("mads_btn"); - QVBoxLayout* madsSettingsLayout = new QVBoxLayout; - madsSettingsLayout->setContentsMargins(0, 0, 0, 30); - madsSettingsLayout->addWidget(madsSettingsButton); connect(madsSettingsButton, &QPushButton::clicked, [=]() { - scrollView->setLastScrollPosition(); + sunnypilotScroller->setLastScrollPosition(); main_layout->setCurrentWidget(madsWidget); }); madsWidget = new MadsSettings(this); connect(madsWidget, &MadsSettings::backPress, [=]() { - scrollView->restoreScrollPosition(); + sunnypilotScroller->restoreScrollPosition(); main_layout->setCurrentWidget(sunnypilotScreen); }); - list->addItem(madsSettingsLayout); + list->addItem(madsSettingsButton); - scrollView = new ScrollViewSP(list, this); - vlayout->addWidget(scrollView); + sunnypilotScroller = new ScrollViewSP(list, this); + vlayout->addWidget(sunnypilotScroller); vlayout->addStretch(1); main_layout->addWidget(sunnypilotScreen); diff --git a/selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot_panel.h b/selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot_panel.h index caefda517f..93bbf72370 100644 --- a/selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot_panel.h +++ b/selfdrive/ui/sunnypilot/qt/offroad/settings/sunnypilot_panel.h @@ -25,7 +25,7 @@ public: private: QStackedLayout* main_layout = nullptr; QWidget* sunnypilotScreen = nullptr; - ScrollViewSP *scrollView = nullptr; + ScrollViewSP *sunnypilotScroller = nullptr; ParamControl *madsToggle; MadsSettings *madsWidget = nullptr;