Onroad compass

Added toggle for a compass in the onroad UI.
This commit is contained in:
FrogAi
2024-02-27 16:34:47 -07:00
parent 55313e6206
commit ac00687b24
8 changed files with 178 additions and 4 deletions

View File

@@ -36,6 +36,27 @@ private:
UIScene &scene;
};
class Compass : public QWidget {
public:
explicit Compass(QWidget *parent = nullptr);
void updateState(int bearing_deg);
protected:
void paintEvent(QPaintEvent *event) override;
private:
int bearingDeg;
int circleOffset;
int compassSize;
int degreeLabelOffset;
int innerCompass;
int x;
int y;
QPixmap compassInnerImg;
QPixmap staticElements;
};
class ExperimentalButton : public QPushButton {
Q_OBJECT
@@ -121,12 +142,15 @@ private:
UIScene &scene;
Compass *compass_img;
QHBoxLayout *bottom_layout;
bool alwaysOnLateral;
bool alwaysOnLateralActive;
bool blindSpotLeft;
bool blindSpotRight;
bool compass;
bool conditionalExperimental;
bool experimentalMode;
bool fullMapOpen;