mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-12 19:33:48 +08:00
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:
@@ -224,7 +224,7 @@ void AnnotatedCameraWidget::drawHud(QPainter &p) {
|
|||||||
p.restore();
|
p.restore();
|
||||||
|
|
||||||
// current speed
|
// current speed
|
||||||
if (!bigMapOpen) {
|
if (!(bigMapOpen || hideSpeed)) {
|
||||||
p.setFont(InterFont(176, QFont::Bold));
|
p.setFont(InterFont(176, QFont::Bold));
|
||||||
drawText(p, rect().center().x(), 210, speedStr);
|
drawText(p, rect().center().x(), 210, speedStr);
|
||||||
p.setFont(InterFont(66));
|
p.setFont(InterFont(66));
|
||||||
@@ -843,6 +843,8 @@ void AnnotatedCameraWidget::paintFrogPilotWidgets(QPainter &painter, const UISce
|
|||||||
|
|
||||||
experimentalMode = scene.experimental_mode;
|
experimentalMode = scene.experimental_mode;
|
||||||
|
|
||||||
|
hideSpeed = scene.hide_speed;
|
||||||
|
|
||||||
laneDetectionWidth = scene.lane_detection_width;
|
laneDetectionWidth = scene.lane_detection_width;
|
||||||
laneWidthLeft = scene.lane_width_left;
|
laneWidthLeft = scene.lane_width_left;
|
||||||
laneWidthRight = scene.lane_width_right;
|
laneWidthRight = scene.lane_width_right;
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ private:
|
|||||||
bool blindSpotRight;
|
bool blindSpotRight;
|
||||||
bool compass;
|
bool compass;
|
||||||
bool experimentalMode;
|
bool experimentalMode;
|
||||||
|
bool hideSpeed;
|
||||||
bool leadInfo;
|
bool leadInfo;
|
||||||
bool mapOpen;
|
bool mapOpen;
|
||||||
bool onroadDistanceButton;
|
bool onroadDistanceButton;
|
||||||
|
|||||||
@@ -127,6 +127,7 @@ void OnroadWindow::mousePressEvent(QMouseEvent* e) {
|
|||||||
QRect leftRect(0, 0, size.width() / 2, size.height());
|
QRect leftRect(0, 0, size.width() / 2, size.height());
|
||||||
QRect rightRect(size.width() / 2, 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 maxSpeedRect(7, 25, 225, 225);
|
||||||
QRect speedLimitRect(7, 250, 225, 225);
|
QRect speedLimitRect(7, 250, 225, 225);
|
||||||
|
|
||||||
@@ -144,6 +145,12 @@ void OnroadWindow::mousePressEvent(QMouseEvent* e) {
|
|||||||
return;
|
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) {
|
if (speedLimitRect.contains(pos) && scene.show_slc_offset_ui) {
|
||||||
scene.show_slc_offset = !scene.show_slc_offset;
|
scene.show_slc_offset = !scene.show_slc_offset;
|
||||||
params.putBoolNonBlocking("ShowSLCOffset", scene.show_slc_offset);
|
params.putBoolNonBlocking("ShowSLCOffset", scene.show_slc_offset);
|
||||||
|
|||||||
@@ -422,6 +422,8 @@ void ui_update_frogpilot_params(UIState *s, Params ¶ms) {
|
|||||||
scene.full_map = scene.big_map && params.getBool("FullMap");
|
scene.full_map = scene.big_map && params.getBool("FullMap");
|
||||||
scene.camera_view = quality_of_life_visuals ? params.getInt("CameraView") : 0;
|
scene.camera_view = quality_of_life_visuals ? params.getInt("CameraView") : 0;
|
||||||
scene.driver_camera = quality_of_life_visuals && params.getBool("DriverCamera");
|
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.speed_limit_controller = scene.longitudinal_control && params.getBool("SpeedLimitController");
|
||||||
scene.show_slc_offset = scene.speed_limit_controller && params.getBool("ShowSLCOffset");
|
scene.show_slc_offset = scene.speed_limit_controller && params.getBool("ShowSLCOffset");
|
||||||
|
|||||||
@@ -146,6 +146,8 @@ typedef struct UIScene {
|
|||||||
bool has_auto_tune;
|
bool has_auto_tune;
|
||||||
bool has_lead;
|
bool has_lead;
|
||||||
bool hide_lead_marker;
|
bool hide_lead_marker;
|
||||||
|
bool hide_speed;
|
||||||
|
bool hide_speed_ui;
|
||||||
bool holiday_themes;
|
bool holiday_themes;
|
||||||
bool is_CPU;
|
bool is_CPU;
|
||||||
bool is_GPU;
|
bool is_GPU;
|
||||||
|
|||||||
Reference in New Issue
Block a user