wip
This commit is contained in:
@@ -17,6 +17,10 @@
|
|||||||
// HomeWindow: the container for the offroad and onroad UIs
|
// HomeWindow: the container for the offroad and onroad UIs
|
||||||
|
|
||||||
HomeWindow::HomeWindow(QWidget* parent) : QWidget(parent) {
|
HomeWindow::HomeWindow(QWidget* parent) : QWidget(parent) {
|
||||||
|
_parent = parent;
|
||||||
|
// Start hidden at first
|
||||||
|
_parent->setVisible(false);
|
||||||
|
|
||||||
// CLEARPILOT Sidebar set to invisible in drive view.
|
// CLEARPILOT Sidebar set to invisible in drive view.
|
||||||
params.putBool("Sidebar", false);
|
params.putBool("Sidebar", false);
|
||||||
|
|
||||||
@@ -52,7 +56,9 @@ HomeWindow::HomeWindow(QWidget* parent) : QWidget(parent) {
|
|||||||
showDriverView(false);
|
showDriverView(false);
|
||||||
});
|
});
|
||||||
slayout->addWidget(driver_view);
|
slayout->addWidget(driver_view);
|
||||||
|
|
||||||
setAttribute(Qt::WA_NoSystemBackground);
|
setAttribute(Qt::WA_NoSystemBackground);
|
||||||
|
|
||||||
QObject::connect(uiState(), &UIState::uiUpdate, this, &HomeWindow::updateState);
|
QObject::connect(uiState(), &UIState::uiUpdate, this, &HomeWindow::updateState);
|
||||||
QObject::connect(uiState(), &UIState::offroadTransition, this, &HomeWindow::offroadTransition);
|
QObject::connect(uiState(), &UIState::offroadTransition, this, &HomeWindow::offroadTransition);
|
||||||
QObject::connect(uiState(), &UIState::offroadTransition, sidebar, &Sidebar::offroadTransition);
|
QObject::connect(uiState(), &UIState::offroadTransition, sidebar, &Sidebar::offroadTransition);
|
||||||
@@ -92,9 +98,11 @@ void HomeWindow::offroadTransition(bool offroad) {
|
|||||||
slayout->setCurrentWidget(onroad);
|
slayout->setCurrentWidget(onroad);
|
||||||
uiState()->scene.map_open = onroad->isMapVisible();
|
uiState()->scene.map_open = onroad->isMapVisible();
|
||||||
}
|
}
|
||||||
|
_parent->setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HomeWindow::showDriverView(bool show, bool started) {
|
void HomeWindow::showDriverView(bool show, bool started) {
|
||||||
|
_parent->setVisible(true);
|
||||||
if (show) {
|
if (show) {
|
||||||
emit closeSettings();
|
emit closeSettings();
|
||||||
slayout->setCurrentWidget(driver_view);
|
slayout->setCurrentWidget(driver_view);
|
||||||
@@ -121,6 +129,7 @@ void HomeWindow::mousePressEvent(QMouseEvent* e) {
|
|||||||
// params.putBool("Sidebar", sidebar->isVisible());
|
// params.putBool("Sidebar", sidebar->isVisible());
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
// CLEARPILOT - click ready shows home
|
// CLEARPILOT - click ready shows home
|
||||||
if (!onroad->isVisible() && ready->isVisible()) {
|
if (!onroad->isVisible() && ready->isVisible()) {
|
||||||
sidebar->setVisible(true);
|
sidebar->setVisible(true);
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ class HomeWindow : public QWidget {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit HomeWindow(QWidget* parent = 0);
|
explicit HomeWindow(QWidget* parent = 0);
|
||||||
|
QWidget* _parent = 0
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void openSettings(int index = 0, const QString ¶m = "");
|
void openSettings(int index = 0, const QString ¶m = "");
|
||||||
|
|||||||
Reference in New Issue
Block a user