This commit is contained in:
Your Name
2024-04-28 15:13:15 -05:00
parent 7c118edb76
commit 96dcadfb7e
2 changed files with 10 additions and 0 deletions

View File

@@ -17,6 +17,10 @@
// HomeWindow: the container for the offroad and onroad UIs
HomeWindow::HomeWindow(QWidget* parent) : QWidget(parent) {
_parent = parent;
// Start hidden at first
_parent->setVisible(false);
// CLEARPILOT Sidebar set to invisible in drive view.
params.putBool("Sidebar", false);
@@ -52,7 +56,9 @@ HomeWindow::HomeWindow(QWidget* parent) : QWidget(parent) {
showDriverView(false);
});
slayout->addWidget(driver_view);
setAttribute(Qt::WA_NoSystemBackground);
QObject::connect(uiState(), &UIState::uiUpdate, this, &HomeWindow::updateState);
QObject::connect(uiState(), &UIState::offroadTransition, this, &HomeWindow::offroadTransition);
QObject::connect(uiState(), &UIState::offroadTransition, sidebar, &Sidebar::offroadTransition);
@@ -92,9 +98,11 @@ void HomeWindow::offroadTransition(bool offroad) {
slayout->setCurrentWidget(onroad);
uiState()->scene.map_open = onroad->isMapVisible();
}
_parent->setVisible(true);
}
void HomeWindow::showDriverView(bool show, bool started) {
_parent->setVisible(true);
if (show) {
emit closeSettings();
slayout->setCurrentWidget(driver_view);
@@ -121,6 +129,7 @@ void HomeWindow::mousePressEvent(QMouseEvent* e) {
// params.putBool("Sidebar", sidebar->isVisible());
// }
// CLEARPILOT - click ready shows home
if (!onroad->isVisible() && ready->isVisible()) {
sidebar->setVisible(true);

View File

@@ -50,6 +50,7 @@ class HomeWindow : public QWidget {
public:
explicit HomeWindow(QWidget* parent = 0);
QWidget* _parent = 0
signals:
void openSettings(int index = 0, const QString &param = "");