mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-24 07:22:04 +08:00
add small minimum time between taps to onboarding (#23212)
Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
@@ -16,6 +16,11 @@ TrainingGuide::TrainingGuide(QWidget *parent) : QFrame(parent) {
|
||||
}
|
||||
|
||||
void TrainingGuide::mouseReleaseEvent(QMouseEvent *e) {
|
||||
if (click_timer.elapsed() < 250) {
|
||||
return;
|
||||
}
|
||||
click_timer.restart();
|
||||
|
||||
if (boundingRect[currentIndex].contains(e->x(), e->y())) {
|
||||
if (currentIndex == 9) {
|
||||
const QRect yes = QRect(692, 842, 492, 148);
|
||||
@@ -40,6 +45,7 @@ void TrainingGuide::showEvent(QShowEvent *event) {
|
||||
|
||||
currentIndex = 0;
|
||||
image.load(img_path + "step0.png");
|
||||
click_timer.start();
|
||||
}
|
||||
|
||||
void TrainingGuide::paintEvent(QPaintEvent *event) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <QElapsedTimer>
|
||||
#include <QImage>
|
||||
#include <QMouseEvent>
|
||||
#include <QPushButton>
|
||||
@@ -74,6 +75,7 @@ private:
|
||||
|
||||
QString img_path;
|
||||
QVector<QRect> boundingRect;
|
||||
QElapsedTimer click_timer;
|
||||
|
||||
signals:
|
||||
void completedTraining();
|
||||
|
||||
Reference in New Issue
Block a user