offroad home styling and cleanup

old-commit-hash: a36632cc39
commatwo_master
Adeeb Shihadeh 4 years ago
parent 0ed4f89d06
commit 99b06dd837
  1. 3
      selfdrive/ui/paint.cc
  2. 10
      selfdrive/ui/qt/home.cc
  3. 13
      selfdrive/ui/qt/widgets/drive_stats.cc
  4. 5
      selfdrive/ui/qt/widgets/drive_stats.hpp

@ -1,4 +1,5 @@
#include "ui.hpp"
#include <assert.h>
#include <map>
#include <cmath>
@ -6,7 +7,6 @@
#include "common/util.h"
#include <algorithm>
#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;

@ -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();

@ -2,10 +2,8 @@
#include <QFile>
#include <QDebug>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QLabel>
#include <QPixmap>
#include <QPushButton>
#include <QLineEdit>
#include <QJsonDocument>
#include <QJsonObject>
@ -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;

@ -1,10 +1,7 @@
#pragma once
#include <QFrame>
#include <QWidget>
#include <QButtonGroup>
#include <QVBoxLayout>
#include <QStackedWidget>
#include <QTimer>
#include <QNetworkReply>

Loading…
Cancel
Save