Skip to content

Commit

Permalink
ui: screen touch fixes (commaai#84)
Browse files Browse the repository at this point in the history
* ui: don't toggle map if buttons are hidden

* keep button the same height during screen touches

* fixed height
  • Loading branch information
sunnyhaibin authored May 31, 2023
1 parent f107f51 commit 5728cd7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion selfdrive/ui/qt/onroad.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ void OnroadWindow::mousePressEvent(QMouseEvent* e) {
propagate_event = false;
}
else if (map != nullptr) {
map->setVisible(!sidebarVisible && !map->isVisible());
if ((uiState()->scene.sleep_btn != 0 && uiState()->scene.sleep_btn_opacity != 0) ||
(uiState()->scene.sleep_time != 0 && uiState()->scene.onroadScreenOff != -2)) {
map->setVisible(!sidebarVisible && !map->isVisible());
}
}
// propagation event to parent(HomeWindow)
if (propagate_event) {
Expand Down
4 changes: 2 additions & 2 deletions selfdrive/ui/qt/screenrecorder/screenrecorder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ void ScreenRecoder::paintEvent(QPaintEvent *event) {
QPainter p(this);
p.setRenderHint(QPainter::Antialiasing);

QPoint center(btn_size / 2 - 25, btn_size / 2 + 10 - uiState()->scene.rn_offset);
QRect rec_btn(36 - 25, 36 + 10 - uiState()->scene.rn_offset, 120, 120);
QPoint center(btn_size / 2 - 25, btn_size / 2 + 10 - 30);
QRect rec_btn(36 - 25, 36 + 10 - 30, 120, 120);

p.setOpacity(1.0);
p.setPen(Qt::NoPen);
Expand Down

0 comments on commit 5728cd7

Please sign in to comment.