mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-02-27 14:13:54 +08:00
* accept touch events in map settings * draft * draft 2.0 * revert this stuff * need this * fix * clean up debug prints * fraft * only show map on closeSettings if nav * works! * can't do it here * I was going to connect signals from UIState to HomeWindow, then to OnroadWidget, but that seems like too much * just need to keep track of it in onroad, seems like the cleanest option * ideally we show the map where we set the scene variable, and that's in map.cc * old variable * comments * less confusing * app comment * add back * fix * move to top * remove this comment
75 lines
1.6 KiB
C++
75 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);
|
|
void showMapPanel(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);
|
|
};
|