diff --git a/selfdrive/ui/qt/home.cc b/selfdrive/ui/qt/home.cc index 740003b3e6..b755a69666 100644 --- a/selfdrive/ui/qt/home.cc +++ b/selfdrive/ui/qt/home.cc @@ -160,7 +160,11 @@ void HomeWindow::setVisibility(bool offroad) { void HomeWindow::mousePressEvent(QMouseEvent* e) { UIState* ui_state = &glWindow->ui_state; - + if (GLWindow::ui_state.started && GLWindow::ui_state.scene.frontview) { + Params().write_db_value("IsDriverViewEnabled", "0", 1); + return; + } + glWindow->wake(); // Settings button click diff --git a/selfdrive/ui/qt/offroad/settings.cc b/selfdrive/ui/qt/offroad/settings.cc index e00d97e7bd..a68f53d76e 100644 --- a/selfdrive/ui/qt/offroad/settings.cc +++ b/selfdrive/ui/qt/offroad/settings.cc @@ -28,6 +28,7 @@ QFrame* horizontal_line(QWidget* parent = 0){ line->setFixedHeight(2); return line; } + QWidget* labelWidget(QString labelName, QString labelContent){ QHBoxLayout* labelLayout = new QHBoxLayout; labelLayout->addWidget(new QLabel(labelName), 0, Qt::AlignLeft); @@ -150,6 +151,14 @@ QWidget * device_panel() { for (auto &l : labels) { device_layout->addWidget(labelWidget(QString::fromStdString(l.first), QString::fromStdString(l.second)), 0, Qt::AlignTop); } + + QPushButton* dcam_view = new QPushButton("Driver camera view"); + device_layout->addWidget(dcam_view, 0, Qt::AlignBottom); + device_layout->addWidget(horizontal_line(), Qt::AlignBottom); + QObject::connect(dcam_view, &QPushButton::released, [=]() { + Params().write_db_value("IsDriverViewEnabled", "1", 1); + }); + // TODO: show current calibration values QPushButton *clear_cal_btn = new QPushButton("Reset Calibration");