reset to main panel when clicked away

This commit is contained in:
Jason Wen
2025-01-04 09:59:55 -05:00
parent 23addfe100
commit 509477c904
2 changed files with 19 additions and 0 deletions
@@ -64,3 +64,17 @@ SunnypilotPanel::SunnypilotPanel(SettingsWindowSP *parent) : QFrame(parent) {
main_layout->setCurrentWidget(sunnypilotScreen);
}
void SunnypilotPanel::showEvent(QShowEvent *event) {
updateToggles();
}
void SunnypilotPanel::hideEvent(QHideEvent *event) {
main_layout->setCurrentWidget(sunnypilotScreen);
}
void SunnypilotPanel::updateToggles() {
if (!isVisible()) {
return;
}
}
@@ -21,6 +21,11 @@ class SunnypilotPanel : public QFrame {
public:
explicit SunnypilotPanel(SettingsWindowSP *parent = nullptr);
void showEvent(QShowEvent *event) override;
void hideEvent(QHideEvent* event) override;
public slots:
void updateToggles();
private:
QStackedLayout* main_layout = nullptr;