diff --git a/selfdrive/ui/paint.cc b/selfdrive/ui/paint.cc index 5e7008b882..eea7151a2c 100644 --- a/selfdrive/ui/paint.cc +++ b/selfdrive/ui/paint.cc @@ -1,4 +1,5 @@ #include "ui.hpp" + #include #include #include @@ -6,7 +7,6 @@ #include "common/util.h" #include - #define NANOVG_GLES3_IMPLEMENTATION #include "nanovg_gl.h" #include "nanovg_gl_utils.h" @@ -226,7 +226,6 @@ static void update_line_data(UIState *s, const cereal::ModelDataV2::XYZTData::Re pvd->cnt = v - pvd->v; } - static void ui_draw_vision_lane_lines(UIState *s) { const UIScene *scene = &s->scene; diff --git a/selfdrive/ui/qt/home.cc b/selfdrive/ui/qt/home.cc index e300d14a37..b1ee784481 100644 --- a/selfdrive/ui/qt/home.cc +++ b/selfdrive/ui/qt/home.cc @@ -26,9 +26,7 @@ OffroadHome::OffroadHome(QWidget *parent) : QWidget(parent) { QVBoxLayout *main_layout = new QVBoxLayout(); main_layout->setContentsMargins(sbr_w + 50, 50, 50, 50); - center_layout = new QStackedLayout(); - - // header + // top header QHBoxLayout *header_layout = new QHBoxLayout(); date = new QLabel(); @@ -45,8 +43,12 @@ OffroadHome::OffroadHome(QWidget *parent) : QWidget(parent) { QObject::connect(alert_notification, SIGNAL(released()), this, SLOT(openAlerts())); main_layout->addWidget(alert_notification, 0, Qt::AlignTop | Qt::AlignRight); + // main content + main_layout->addSpacing(100); + center_layout = new QStackedLayout(); + DriveStats *drive = new DriveStats; - drive->setFixedSize(1000,800); + drive->setFixedSize(1000, 800); center_layout->addWidget(drive); alerts_widget = new OffroadAlert(); diff --git a/selfdrive/ui/qt/widgets/drive_stats.cc b/selfdrive/ui/qt/widgets/drive_stats.cc index 937d0359a4..cff462bcfc 100644 --- a/selfdrive/ui/qt/widgets/drive_stats.cc +++ b/selfdrive/ui/qt/widgets/drive_stats.cc @@ -2,10 +2,8 @@ #include #include -#include +#include #include -#include -#include #include #include #include @@ -134,25 +132,24 @@ void DriveStats::replyFinished(QNetworkReply *l){ gl->addWidget(build_stat(metric ? "KM" : "MILES", week_distance), 7, 1, 3, 1); gl->addWidget(build_stat("HOURS", week["minutes"].toDouble() / 60), 7, 2, 3, 1); - f->setLayout(gl); f->setStyleSheet(R"( - [class="line"]{ + [class="line"] { border: 2px solid white; } - [class="outside"]{ + [class="outside"] { border-radius: 20px; border: 2px solid white; padding: 10px; } - QLabel{ + QLabel { font-size: 70px; font-weight: 200; } )"); } -DriveStats::DriveStats(QWidget *parent) : QWidget(parent){ +DriveStats::DriveStats(QWidget *parent) : QWidget(parent) { f = new QFrame; f->setProperty("class", "outside"); QVBoxLayout *v = new QVBoxLayout; diff --git a/selfdrive/ui/qt/widgets/drive_stats.hpp b/selfdrive/ui/qt/widgets/drive_stats.hpp index 9b607f999b..3a9731ca88 100644 --- a/selfdrive/ui/qt/widgets/drive_stats.hpp +++ b/selfdrive/ui/qt/widgets/drive_stats.hpp @@ -1,10 +1,7 @@ #pragma once +#include #include -#include -#include -#include -#include #include