training guide updates (#21674)

* add progress bar

* shorter

* update lane change speed

* fix

* center

* fix cutoff
pull/21677/head
Adeeb Shihadeh 2021-07-21 17:28:35 -07:00 committed by GitHub
parent 2f18715f76
commit 75904ed745
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 900 KiB

After

Width:  |  Height:  |  Size: 897 KiB

View File

@ -34,12 +34,18 @@ void TrainingGuide::paintEvent(QPaintEvent *event) {
QPainter painter(this);
QRect bg(0, 0, painter.device()->width(), painter.device()->height());
QBrush bgBrush("#000000");
painter.fillRect(bg, bgBrush);
painter.fillRect(bg, QColor("#000000"));
QRect rect(image.rect());
rect.moveCenter(bg.center());
painter.drawImage(rect.topLeft(), image);
// progress bar
if (currentIndex > 0 && currentIndex < (boundingRect.size() - 2)) {
const int h = 20;
const int w = (currentIndex / (float)(boundingRect.size() - 2)) * width();
painter.fillRect(QRect(0, height() - h, w, h), QColor("#465BEA"));
}
}
void TermsPage::showEvent(QShowEvent *event) {