mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-22 14:32:07 +08:00
ui: metric wider set speed box (#24890)
This commit is contained in:
@@ -196,6 +196,7 @@ void NvgWindow::updateState(const UIState &s) {
|
||||
setProperty("has_eu_speed_limit", nav_alive && speed_limit_sign == cereal::NavInstruction::SpeedLimitSign::VIENNA);
|
||||
|
||||
setProperty("is_cruise_set", cruise_set);
|
||||
setProperty("is_metric", s.scene.is_metric);
|
||||
setProperty("speed", cur_speed);
|
||||
setProperty("setSpeed", set_speed);
|
||||
setProperty("speedUnit", s.scene.is_metric ? "km/h" : "mph");
|
||||
@@ -225,8 +226,8 @@ void NvgWindow::drawHud(QPainter &p) {
|
||||
// Draw outer box + border to contain set speed and speed limit
|
||||
int default_rect_width = 172;
|
||||
int rect_width = default_rect_width;
|
||||
if (is_metric || has_eu_speed_limit) rect_width = 200;
|
||||
if (has_us_speed_limit && speedLimitStr.size() >= 3) rect_width = 223;
|
||||
else if (has_eu_speed_limit) rect_width = 200;
|
||||
|
||||
int rect_height = 204;
|
||||
if (has_us_speed_limit) rect_height = 402;
|
||||
|
||||
@@ -34,6 +34,7 @@ class NvgWindow : public CameraViewWidget {
|
||||
Q_PROPERTY(bool is_cruise_set MEMBER is_cruise_set);
|
||||
Q_PROPERTY(bool has_eu_speed_limit MEMBER has_eu_speed_limit);
|
||||
Q_PROPERTY(bool has_us_speed_limit MEMBER has_us_speed_limit);
|
||||
Q_PROPERTY(bool is_metric MEMBER is_metric);
|
||||
|
||||
Q_PROPERTY(bool engageable MEMBER engageable);
|
||||
Q_PROPERTY(bool dmActive MEMBER dmActive);
|
||||
@@ -57,6 +58,7 @@ private:
|
||||
float setSpeed;
|
||||
float speedLimit;
|
||||
bool is_cruise_set = false;
|
||||
bool is_metric = false;
|
||||
bool engageable = false;
|
||||
bool dmActive = false;
|
||||
bool hideDM = false;
|
||||
|
||||
Reference in New Issue
Block a user