Visuals - Quality of Life - Hide Speed

Hide the speed indicator in the onroad UI. Additional toggle allows it to be hidden/shown via tapping the speed itself.
This commit is contained in:
FrogAi 2024-05-11 15:11:23 -07:00
parent 734eca32a6
commit 8984a623fd
5 changed files with 15 additions and 1 deletions

View File

@ -224,7 +224,7 @@ void AnnotatedCameraWidget::drawHud(QPainter &p) {
p.restore();
// current speed
if (!bigMapOpen) {
if (!(bigMapOpen || hideSpeed)) {
p.setFont(InterFont(176, QFont::Bold));
drawText(p, rect().center().x(), 210, speedStr);
p.setFont(InterFont(66));
@ -843,6 +843,8 @@ void AnnotatedCameraWidget::paintFrogPilotWidgets(QPainter &painter, const UISce
experimentalMode = scene.experimental_mode;
hideSpeed = scene.hide_speed;
laneDetectionWidth = scene.lane_detection_width;
laneWidthLeft = scene.lane_width_left;
laneWidthRight = scene.lane_width_right;

View File

@ -111,6 +111,7 @@ private:
bool blindSpotRight;
bool compass;
bool experimentalMode;
bool hideSpeed;
bool leadInfo;
bool mapOpen;
bool onroadDistanceButton;

View File

@ -127,6 +127,7 @@ void OnroadWindow::mousePressEvent(QMouseEvent* e) {
QRect leftRect(0, 0, size.width() / 2, size.height());
QRect rightRect(size.width() / 2, 0, size.width() / 2, size.height());
QRect hideSpeedRect(rect().center().x() - 175, 50, 350, 350);
QRect maxSpeedRect(7, 25, 225, 225);
QRect speedLimitRect(7, 250, 225, 225);
@ -144,6 +145,12 @@ void OnroadWindow::mousePressEvent(QMouseEvent* e) {
return;
}
if (hideSpeedRect.contains(pos) && scene.hide_speed_ui) {
scene.hide_speed = !scene.hide_speed;
params.putBoolNonBlocking("HideSpeed", scene.hide_speed);
return;
}
if (speedLimitRect.contains(pos) && scene.show_slc_offset_ui) {
scene.show_slc_offset = !scene.show_slc_offset;
params.putBoolNonBlocking("ShowSLCOffset", scene.show_slc_offset);

View File

@ -422,6 +422,8 @@ void ui_update_frogpilot_params(UIState *s, Params &params) {
scene.full_map = scene.big_map && params.getBool("FullMap");
scene.camera_view = quality_of_life_visuals ? params.getInt("CameraView") : 0;
scene.driver_camera = quality_of_life_visuals && params.getBool("DriverCamera");
scene.hide_speed = quality_of_life_visuals && params.getBool("HideSpeed");
scene.hide_speed_ui = scene.hide_speed && params.getBool("HideSpeedUI");
scene.speed_limit_controller = scene.longitudinal_control && params.getBool("SpeedLimitController");
scene.show_slc_offset = scene.speed_limit_controller && params.getBool("ShowSLCOffset");

View File

@ -146,6 +146,8 @@ typedef struct UIScene {
bool has_auto_tune;
bool has_lead;
bool hide_lead_marker;
bool hide_speed;
bool hide_speed_ui;
bool holiday_themes;
bool is_CPU;
bool is_GPU;