UI: PrimeUserWidget cleanup (#28300)

* cleanup

* setMargin is obsolete

* more
old-commit-hash: 13cf695738
beeps
Cameron Clough 2 years ago committed by GitHub
parent c2e86afc8c
commit 7db6687227
  1. 12
      selfdrive/ui/qt/widgets/prime.cc
  2. 8
      selfdrive/ui/qt/widgets/prime.h

@ -114,17 +114,16 @@ PairingPopup::PairingPopup(QWidget *parent) : QDialogBase(parent) {
} }
PrimeUserWidget::PrimeUserWidget(QWidget* parent) : QWidget(parent) { PrimeUserWidget::PrimeUserWidget(QWidget* parent) : QFrame(parent) {
mainLayout = new QVBoxLayout(this); QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setMargin(0); mainLayout->setContentsMargins(0, 0, 0, 0);
mainLayout->setSpacing(30); mainLayout->setSpacing(30);
// subscribed prime layout // subscribed prime layout
QWidget *primeWidget = new QWidget; QWidget *primeWidget = new QWidget;
primeWidget->setObjectName("primeWidget"); primeWidget->setObjectName("primeWidget");
QVBoxLayout *primeLayout = new QVBoxLayout(primeWidget); QVBoxLayout *primeLayout = new QVBoxLayout(primeWidget);
primeLayout->setMargin(0); primeLayout->setContentsMargins(60, 50, 60, 50);
primeWidget->setContentsMargins(60, 50, 60, 50);
QLabel *subscribed = new QLabel(tr("✓ SUBSCRIBED")); QLabel *subscribed = new QLabel(tr("✓ SUBSCRIBED"));
subscribed->setStyleSheet("font-size: 41px; font-weight: bold; color: #86FF4E;"); subscribed->setStyleSheet("font-size: 41px; font-weight: bold; color: #86FF4E;");
@ -148,8 +147,7 @@ PrimeUserWidget::PrimeUserWidget(QWidget* parent) : QWidget(parent) {
QWidget *pointsWidget = new QWidget; QWidget *pointsWidget = new QWidget;
pointsWidget->setObjectName("primeWidget"); pointsWidget->setObjectName("primeWidget");
QVBoxLayout *pointsLayout = new QVBoxLayout(pointsWidget); QVBoxLayout *pointsLayout = new QVBoxLayout(pointsWidget);
pointsLayout->setMargin(0); pointsLayout->setContentsMargins(60, 50, 60, 50);
pointsWidget->setContentsMargins(60, 50, 60, 50);
QLabel *commaPoints = new QLabel(tr("COMMA POINTS")); QLabel *commaPoints = new QLabel(tr("COMMA POINTS"));
commaPoints->setStyleSheet("font-size: 41px; font-family: Inter SemiBold;"); commaPoints->setStyleSheet("font-size: 41px; font-family: Inter SemiBold;");

@ -15,6 +15,7 @@ enum PrimeType {
MAGENTA_NEW = 4, MAGENTA_NEW = 4,
}; };
// pairing QR code // pairing QR code
class PairingQRWidget : public QWidget { class PairingQRWidget : public QWidget {
Q_OBJECT Q_OBJECT
@ -34,6 +35,7 @@ private slots:
void refresh(); void refresh();
}; };
// pairing popup widget // pairing popup widget
class PairingPopup : public QDialogBase { class PairingPopup : public QDialogBase {
Q_OBJECT Q_OBJECT
@ -42,14 +44,15 @@ public:
explicit PairingPopup(QWidget* parent); explicit PairingPopup(QWidget* parent);
}; };
// widget for paired users with prime // widget for paired users with prime
class PrimeUserWidget : public QWidget { class PrimeUserWidget : public QFrame {
Q_OBJECT Q_OBJECT
public: public:
explicit PrimeUserWidget(QWidget* parent = 0); explicit PrimeUserWidget(QWidget* parent = 0);
private: private:
QVBoxLayout* mainLayout;
QLabel *points; QLabel *points;
private slots: private slots:
@ -64,6 +67,7 @@ public:
explicit PrimeAdWidget(QWidget* parent = 0); explicit PrimeAdWidget(QWidget* parent = 0);
}; };
// container widget // container widget
class SetupWidget : public QFrame { class SetupWidget : public QFrame {
Q_OBJECT Q_OBJECT

Loading…
Cancel
Save