Visuals - Screen Management - Hide UI Elements - Map Icon

Hide the map icon button on the onroad screen.
This commit is contained in:
FrogAi 2024-05-11 15:42:11 -07:00
parent 89ab6b591a
commit cf06c93c0a
4 changed files with 7 additions and 3 deletions

View File

@ -92,7 +92,7 @@ void AnnotatedCameraWidget::updateState(const UIState &s) {
// hide map settings button for alerts and flip for right hand DM
if (map_settings_btn->isEnabled()) {
map_settings_btn->setVisible(!hideBottomIcons && compass);
map_settings_btn->setVisible(!hideBottomIcons && compass && !hideMapIcon);
main_layout->setAlignment(map_settings_btn, (rightHandDM && !compass || !rightHandDM && compass ? Qt::AlignLeft : Qt::AlignRight) | Qt::AlignBottom);
}
}
@ -534,7 +534,7 @@ void AnnotatedCameraWidget::drawDriverState(QPainter &painter, const UIState *s)
// base icon
int offset = UI_BORDER_SIZE + btn_size / 2;
int x = rightHandDM ? width() - offset : offset;
if (rightHandDM && map_settings_btn->isEnabled()) {
if (rightHandDM && map_settings_btn->isEnabled() && !hideMapIcon) {
x -= 250;
} else if (onroadDistanceButton) {
x += 250;
@ -879,6 +879,7 @@ void AnnotatedCameraWidget::paintFrogPilotWidgets(QPainter &painter, const UISce
experimentalMode = scene.experimental_mode;
hideMapIcon = scene.hide_map_icon;
hideSpeed = scene.hide_speed;
laneDetectionWidth = scene.lane_detection_width;
@ -896,7 +897,7 @@ void AnnotatedCameraWidget::paintFrogPilotWidgets(QPainter &painter, const UISce
bigMapOpen = mapOpen && scene.big_map;
map_settings_btn_bottom->setEnabled(map_settings_btn->isEnabled());
if (map_settings_btn_bottom->isEnabled()) {
map_settings_btn_bottom->setVisible(!hideBottomIcons && !compass);
map_settings_btn_bottom->setVisible(!hideBottomIcons && !compass && !hideMapIcon);
bottom_layout->setAlignment(map_settings_btn_bottom, (rightHandDM ? Qt::AlignLeft : Qt::AlignRight) | Qt::AlignBottom);
}

View File

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

View File

@ -431,6 +431,7 @@ void ui_update_frogpilot_params(UIState *s, Params &params) {
bool screen_management = params.getBool("ScreenManagement");
bool hide_ui_elements = screen_management && params.getBool("HideUIElements");
scene.hide_alerts = hide_ui_elements && params.getBool("HideAlerts");
scene.hide_map_icon = hide_ui_elements && params.getBool("HideMapIcon");
scene.speed_limit_controller = scene.longitudinal_control && params.getBool("SpeedLimitController");
scene.show_slc_offset = scene.speed_limit_controller && params.getBool("ShowSLCOffset");

View File

@ -147,6 +147,7 @@ typedef struct UIScene {
bool has_lead;
bool hide_alerts;
bool hide_lead_marker;
bool hide_map_icon;
bool hide_speed;
bool hide_speed_ui;
bool holiday_themes;