Files
StarPilot/selfdrive/ui/qt/onroad/buttons.h
T
2026-03-28 18:35:57 -05:00

47 lines
964 B
C++

#pragma once
#include <QPushButton>
#include "selfdrive/ui/ui.h"
const int btn_size = 192;
const int img_size = (btn_size / 4) * 3;
class ExperimentalButton : public QPushButton {
Q_OBJECT
public:
explicit ExperimentalButton(QWidget *parent = 0);
void updateState(const UIState &s, const StarPilotUIState &fs);
StarPilotUIScene starpilot_scene;
QJsonObject starpilot_toggles;
private:
void paintEvent(QPaintEvent *event) override;
void changeMode();
Params params;
QPixmap engage_img;
QPixmap experimental_img;
bool experimental_mode;
bool engageable;
void showEvent(QShowEvent *event) override;
void updateBackgroundColor();
void updateTheme();
int steering_angle_deg;
Params params_memory{"", true};
QColor background_color;
QPixmap wheel_img;
QSharedPointer<QMovie> wheel_gif;
};
void drawIcon(QPainter &p, const QPoint &center, const QPixmap &img, const QBrush &bg, float opacity, const int &angle = 0);