mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-05 00:05:59 +08:00
ui/map: fix wrong remaining time (#28960)
This commit is contained in:
@@ -548,9 +548,8 @@ void MapETA::updateETA(float s, float s_typical, float d) {
|
||||
: std::array{eta_t.toString("h:mm a").split(' ')[0], eta_t.toString("a")};
|
||||
|
||||
// Remaining time
|
||||
auto time_t = QDateTime::fromTime_t(s);
|
||||
auto remaining = s < 3600 ? std::array{time_t.toString("m"), tr("min")}
|
||||
: std::array{time_t.toString("h:mm"), tr("hr")};
|
||||
auto remaining = s < 3600 ? std::array{QString::number(int(s / 60)), tr("min")}
|
||||
: std::array{QString("%1:%2").arg((int)s / 3600).arg(((int)s % 3600) / 60, 2, 10, QLatin1Char('0')), tr("hr")};
|
||||
QString color = "#25DA6E";
|
||||
if (s / s_typical > 1.5) color = "#DA3025";
|
||||
else if (s / s_typical > 1.2) color = "#DAA725";
|
||||
|
||||
Reference in New Issue
Block a user