more housekeeping

This commit is contained in:
Jason Wen
2025-01-04 09:46:13 -05:00
parent 09a5da6bbe
commit 0270ba70f4
2 changed files with 6 additions and 9 deletions
@@ -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);
@@ -25,7 +25,7 @@ public:
private:
QStackedLayout* main_layout = nullptr;
QWidget* sunnypilotScreen = nullptr;
ScrollViewSP *scrollView = nullptr;
ScrollViewSP *sunnypilotScroller = nullptr;
ParamControl *madsToggle;
MadsSettings *madsWidget = nullptr;