mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-09-30 14:53:53 +08:00
3966599e9d
* Revert "Revert "ui: sunnypilot offroad UI" (#511)" This reverts commit0e264e1b05. * Revert "move files to sp dir" This reverts commitc72d732259. * remove drive stats for now * update translation * update onboarding * remove sp onboarding for now * rearrange * remove more * shorter license
45 lines
768 B
C++
45 lines
768 B
C++
#pragma once
|
|
|
|
#include <QMovie>
|
|
#include <QLabel>
|
|
#include <QPushButton>
|
|
|
|
#include "common/util.h"
|
|
|
|
#ifdef SUNNYPILOT
|
|
#include "selfdrive/ui/sunnypilot/ui.h"
|
|
#define UIState UIStateSP
|
|
#else
|
|
#include "selfdrive/ui/ui.h"
|
|
#endif
|
|
|
|
class RecordButton : public QPushButton {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
RecordButton(QWidget* parent = 0);
|
|
|
|
private:
|
|
void paintEvent(QPaintEvent*) override;
|
|
};
|
|
|
|
class BodyWindow : public QWidget {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
BodyWindow(QWidget* parent = 0);
|
|
|
|
private:
|
|
bool charging = false;
|
|
uint64_t last_button = 0;
|
|
FirstOrderFilter fuel_filter;
|
|
QLabel *face;
|
|
QMovie *awake, *sleep;
|
|
RecordButton *btn;
|
|
void paintEvent(QPaintEvent*) override;
|
|
|
|
private slots:
|
|
void updateState(const UIState &s);
|
|
void offroadTransition(bool onroad);
|
|
};
|