diff --git a/common/params.cc b/common/params.cc index 3749f5c..0e25b8e 100644 --- a/common/params.cc +++ b/common/params.cc @@ -269,6 +269,7 @@ std::unordered_map keys = { {"FrogPilotTogglesUpdated", PERSISTENT}, {"FrogsGoMoo", PERSISTENT}, {"FrogsGoMooTune", PERSISTENT}, + {"FullMap", PERSISTENT}, {"GoatScream", PERSISTENT}, {"LaneLinesWidth", PERSISTENT}, {"LateralTune", PERSISTENT}, diff --git a/selfdrive/frogpilot/ui/visual_settings.cc b/selfdrive/frogpilot/ui/visual_settings.cc index 5678e52..b888307 100644 --- a/selfdrive/frogpilot/ui/visual_settings.cc +++ b/selfdrive/frogpilot/ui/visual_settings.cc @@ -40,6 +40,7 @@ FrogPilotVisualsPanel::FrogPilotVisualsPanel(SettingsWindow *parent) : FrogPilot {"QOLVisuals", "Quality of Life", "Miscellaneous quality of life changes to improve your overall openpilot experience.", "../frogpilot/assets/toggle_icons/quality_of_life.png"}, {"DriveStats", "Drive Stats In Home Screen", "Display your device's drive stats in the home screen.", ""}, + {"FullMap", "Full Sized Map", "Maximize the size of the map in the onroad UI.", ""}, }; for (const auto &[param, title, desc, icon] : visualToggles) { diff --git a/selfdrive/frogpilot/ui/visual_settings.h b/selfdrive/frogpilot/ui/visual_settings.h index 6e8e8cb..77fd915 100644 --- a/selfdrive/frogpilot/ui/visual_settings.h +++ b/selfdrive/frogpilot/ui/visual_settings.h @@ -33,7 +33,7 @@ private: std::set customOnroadUIKeys = {"AccelerationPath", "AdjacentPath", "BlindSpotPath", "FPSCounter", "LeadInfo"}; std::set customThemeKeys = {"CustomColors", "CustomIcons", "CustomSignals", "CustomSounds"}; std::set modelUIKeys = {"DynamicPathWidth", "LaneLinesWidth", "PathEdgeWidth", "PathWidth", "RoadEdgesWidth", "UnlimitedLength"}; - std::set qolKeys = {"DriveStats"}; + std::set qolKeys = {"DriveStats", "FullMap"}; std::map toggles; diff --git a/selfdrive/ui/qt/onroad.cc b/selfdrive/ui/qt/onroad.cc index f4c8da8..33a9eb4 100644 --- a/selfdrive/ui/qt/onroad.cc +++ b/selfdrive/ui/qt/onroad.cc @@ -84,7 +84,7 @@ void OnroadWindow::updateState(const UIState &s) { Alert alert = Alert::get(*(s.sm), s.scene.started_frame); alerts->updateAlert(alert); - if (s.scene.map_on_left) { + if (s.scene.map_on_left || scene.full_map) { split->setDirection(QBoxLayout::LeftToRight); } else { split->setDirection(QBoxLayout::RightToLeft); @@ -131,6 +131,11 @@ void OnroadWindow::mousePressEvent(QMouseEvent* e) { bool show_map = uiState()->scene.navigate_on_openpilot ? sidebarVisible : !sidebarVisible; if (!clickTimer.isActive()) { map->setVisible(show_map && !map->isVisible()); + if (scene.full_map) { + map->setFixedWidth(width()); + } else { + map->setFixedWidth(topWidget(this)->width() / 2 - UI_BORDER_SIZE); + } } } #endif @@ -342,7 +347,7 @@ void ExperimentalButton::paintEvent(QPaintEvent *event) { QPainter p(this); QPixmap img = experimental_mode ? experimental_img : engage_img; - if (!scene.show_driver_camera) { + if (!(scene.show_driver_camera || scene.map_open && scene.full_map)) { drawIcon(p, QPoint(btn_size / 2, btn_size / 2 + y_offset), img, QColor(0, 0, 0, 166), (isDown() || !(engageable || scene.always_on_lateral_active)) ? 0.6 : 1.0); } } @@ -416,7 +421,7 @@ void AnnotatedCameraWidget::updateState(const UIState &s) { has_eu_speed_limit = (nav_alive && speed_limit_sign == cereal::NavInstruction::SpeedLimitSign::VIENNA); is_metric = s.scene.is_metric; speedUnit = s.scene.is_metric ? tr("km/h") : tr("mph"); - hideBottomIcons = (cs.getAlertSize() != cereal::ControlsState::AlertSize::NONE || customSignals && (turnSignalLeft || turnSignalRight)) || showDriverCamera; + hideBottomIcons = (cs.getAlertSize() != cereal::ControlsState::AlertSize::NONE || customSignals && (turnSignalLeft || turnSignalRight)) || fullMapOpen || showDriverCamera; status = s.status; // update engageability/experimental mode button @@ -528,7 +533,7 @@ void AnnotatedCameraWidget::drawHud(QPainter &p) { } // current speed - if (!showDriverCamera) { + if (!(fullMapOpen || showDriverCamera)) { p.setFont(InterFont(176, QFont::Bold)); drawText(p, rect().center().x(), 210, speedStr); p.setFont(InterFont(66)); @@ -1027,13 +1032,14 @@ void AnnotatedCameraWidget::updateFrogPilotWidgets(QPainter &p) { obstacleDistanceStock = scene.obstacle_distance_stock; mapOpen = scene.map_open; + fullMapOpen = mapOpen && scene.full_map; showDriverCamera = scene.show_driver_camera; turnSignalLeft = scene.turn_signal_left; turnSignalRight = scene.turn_signal_right; - if (!showDriverCamera) { + if (!(showDriverCamera || fullMapOpen)) { if (leadInfo) { drawLeadInfo(p); } diff --git a/selfdrive/ui/qt/onroad.h b/selfdrive/ui/qt/onroad.h index 65ac4a5..762cf3e 100644 --- a/selfdrive/ui/qt/onroad.h +++ b/selfdrive/ui/qt/onroad.h @@ -129,6 +129,7 @@ private: bool blindSpotRight; bool conditionalExperimental; bool experimentalMode; + bool fullMapOpen; bool leadInfo; bool mapOpen; bool showDriverCamera; diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index cf85805..978cde2 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -320,6 +320,7 @@ void ui_update_frogpilot_params(UIState *s) { bool quality_of_life_controls = params.getBool("QOLControls"); bool quality_of_life_visuals = params.getBool("QOLVisuals"); + scene.full_map = quality_of_life_visuals && params.getBool("FullMap"); } void UIState::updateStatus() { diff --git a/selfdrive/ui/ui.h b/selfdrive/ui/ui.h index 9a4a8e2..22f4924 100644 --- a/selfdrive/ui/ui.h +++ b/selfdrive/ui/ui.h @@ -184,6 +184,7 @@ typedef struct UIScene { bool experimental_mode; bool experimental_mode_via_screen; bool fps_counter; + bool full_map; bool lead_info; bool map_open; bool model_ui;