From ee7682ae4a53d8b85872cf1f06e614c740edf9c9 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Fri, 3 Sep 2021 15:45:02 -0700 Subject: [PATCH] only toggle sidebar visibility when clicking on the onroad widget --- selfdrive/ui/qt/home.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/ui/qt/home.cc b/selfdrive/ui/qt/home.cc index bf4a76386b..5484c5d743 100644 --- a/selfdrive/ui/qt/home.cc +++ b/selfdrive/ui/qt/home.cc @@ -68,7 +68,7 @@ void HomeWindow::showDriverView(bool show) { void HomeWindow::mousePressEvent(QMouseEvent* e) { // Handle sidebar collapsing - if (onroad->isVisible()) { + if (onroad->isVisible() && (!sidebar->isVisible() || e->x() > sidebar->width())) { sidebar->setVisible(!sidebar->isVisible() && !onroad->isMapVisible()); } }