This commit is contained in:
Your Name
2024-05-09 21:23:23 -05:00
parent fbd09ad9bd
commit 7d9065c868
3 changed files with 18 additions and 6 deletions

View File

@@ -88,7 +88,6 @@ void HomeWindow::offroadTransition(bool offroad) {
if (offroad) {
sidebar->setVisible(false);
slayout->setCurrentWidget(ready);
refresh();
// this->showDriverView(true, true); // Temp
} else {
sidebar->setVisible(false);
@@ -266,8 +265,4 @@ void OffroadHome::refresh() {
if (alerts) {
alert_notif->setText(QString::number(alerts) + (alerts > 1 ? tr(" ALERTS") : tr(" ALERT")));
}
if (ready->isVisible()) {
ready->refresh();
}
}

View File

@@ -27,6 +27,19 @@ ReadyWindow::ReadyWindow(QWidget *parent) : QWidget(parent) {
setAttribute(Qt::WA_OpaquePaintEvent);
setStyleSheet("ReadyWindow { background-color: black; }");
timer = new QTimer(this);
timer->callOnTimeout(this, &ReadyWindow::refresh);
}
void ReadyWindow::showEvent(QShowEvent *event) {
refresh();
timer->start(5 * 1000);
}
void ReadyWindow::hideEvent(QHideEvent *event) {
timer->stop();
}
void ReadyWindow::paintEvent(QPaintEvent *event) {

View File

@@ -18,8 +18,12 @@ class ReadyWindow : public QWidget {
public:
ReadyWindow(QWidget* parent = nullptr);
private:
void paintEvent(QPaintEvent *event) override;
void showEvent(QShowEvent *event) override;
void hideEvent(QHideEvent *event) override;
void refresh();
void paintEvent(QPaintEvent *event) override;
Params params;
QTimer* timer;
bool is_hot = false;
QString cur_temp;
QPixmap img_ready;