Skip to content

Commit

Permalink
UI: fix reset calibration description
Browse files Browse the repository at this point in the history
  • Loading branch information
adeebshihadeh committed Jul 7, 2022
1 parent dc3d94d commit ff3f6de
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions selfdrive/ui/qt/widgets/controls.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,23 @@ AbstractControl::AbstractControl(const QString &title, const QString &desc, cons
main_layout->addLayout(hlayout);

// description
if (!desc.isEmpty()) {
description = new QLabel(desc);
description->setContentsMargins(40, 20, 40, 20);
description->setStyleSheet("font-size: 40px; color: grey");
description->setWordWrap(true);
description->setVisible(false);
main_layout->addWidget(description);

connect(title_label, &QPushButton::clicked, [=]() {
if (!description->isVisible()) {
emit showDescription();
}
description = new QLabel(desc);
description->setContentsMargins(40, 20, 40, 20);
description->setStyleSheet("font-size: 40px; color: grey");
description->setWordWrap(true);
description->setVisible(false);
main_layout->addWidget(description);

connect(title_label, &QPushButton::clicked, [=]() {
if (!description->isVisible()) {
emit showDescription();
}

if (!description->text().isEmpty()) {
description->setVisible(!description->isVisible());
});
}
}
});

main_layout->addStretch();
}

Expand Down

0 comments on commit ff3f6de

Please sign in to comment.