mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-07-16 15:12:27 +08:00
reset to main panel when clicked away
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user