mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-09-30 19:33:49 +08:00
dcd22dda7a
* draft
* draft
* before qpushbutton
* icon, clean up button, clicked goes to toggles
* fix icon
* add imgs
* img
* make square
* works with layouts!
* fix gradient
* this looks good
* clean up
* clean up
* remove padding around couch
* use scene's experimental_model, new onroad design
* rename widget
* def want 3
* update translations
* add img
* add 25px of padding!
* make 300px (no change)
* clean up old images
* 5 px smaller
* add white img
* fix from merge
* no style sheets
* see how this looks on device
* aliased vertical line (clean up)
* clean up
* imgs
* couch
* delete
* bye bye
* expand toggle support
* clean up
* fix dynamic icon
* make exp icon dynamic
* order
* move to offroad
old-commit-hash: 58b84fb401
74 lines
1.6 KiB
C++
74 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include <QFrame>
|
|
#include <QLabel>
|
|
#include <QPushButton>
|
|
#include <QStackedLayout>
|
|
#include <QTimer>
|
|
#include <QWidget>
|
|
|
|
#include "common/params.h"
|
|
#include "selfdrive/ui/qt/offroad/driverview.h"
|
|
#include "selfdrive/ui/qt/body.h"
|
|
#include "selfdrive/ui/qt/onroad.h"
|
|
#include "selfdrive/ui/qt/sidebar.h"
|
|
#include "selfdrive/ui/qt/widgets/controls.h"
|
|
#include "selfdrive/ui/qt/widgets/offroad_alerts.h"
|
|
#include "selfdrive/ui/ui.h"
|
|
|
|
class OffroadHome : public QFrame {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit OffroadHome(QWidget* parent = 0);
|
|
|
|
signals:
|
|
void openSettings(int index = 0, const QString ¶m = "");
|
|
|
|
private:
|
|
void showEvent(QShowEvent *event) override;
|
|
void hideEvent(QHideEvent *event) override;
|
|
void refresh();
|
|
|
|
Params params;
|
|
|
|
QTimer* timer;
|
|
ElidedLabel* version;
|
|
QStackedLayout* center_layout;
|
|
UpdateAlert *update_widget;
|
|
OffroadAlert* alerts_widget;
|
|
QPushButton* alert_notif;
|
|
QPushButton* update_notif;
|
|
};
|
|
|
|
class HomeWindow : public QWidget {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit HomeWindow(QWidget* parent = 0);
|
|
|
|
signals:
|
|
void openSettings(int index = 0, const QString ¶m = "");
|
|
void closeSettings();
|
|
|
|
public slots:
|
|
void offroadTransition(bool offroad);
|
|
void showDriverView(bool show);
|
|
void showSidebar(bool show);
|
|
|
|
protected:
|
|
void mousePressEvent(QMouseEvent* e) override;
|
|
void mouseDoubleClickEvent(QMouseEvent* e) override;
|
|
|
|
private:
|
|
Sidebar *sidebar;
|
|
OffroadHome *home;
|
|
OnroadWindow *onroad;
|
|
BodyWindow *body;
|
|
DriverViewWindow *driver_view;
|
|
QStackedLayout *slayout;
|
|
|
|
private slots:
|
|
void updateState(const UIState &s);
|
|
};
|