|
|
|
@ -146,18 +146,18 @@ void OnroadAlerts::paintEvent(QPaintEvent *event) { |
|
|
|
|
p.setPen(QColor(0xff, 0xff, 0xff)); |
|
|
|
|
p.setRenderHint(QPainter::TextAntialiasing); |
|
|
|
|
if (alert.size == cereal::ControlsState::AlertSize::SMALL) { |
|
|
|
|
configFont(p, "Open Sans", 74, "SemiBold"); |
|
|
|
|
configFont(p, "Inter", 74, "SemiBold"); |
|
|
|
|
p.drawText(r, Qt::AlignCenter, alert.text1); |
|
|
|
|
} else if (alert.size == cereal::ControlsState::AlertSize::MID) { |
|
|
|
|
configFont(p, "Open Sans", 88, "Bold"); |
|
|
|
|
configFont(p, "Inter", 88, "Bold"); |
|
|
|
|
p.drawText(QRect(0, c.y() - 125, width(), 150), Qt::AlignHCenter | Qt::AlignTop, alert.text1); |
|
|
|
|
configFont(p, "Open Sans", 66, "Regular"); |
|
|
|
|
configFont(p, "Inter", 66, "Regular"); |
|
|
|
|
p.drawText(QRect(0, c.y() + 21, width(), 90), Qt::AlignHCenter, alert.text2); |
|
|
|
|
} else if (alert.size == cereal::ControlsState::AlertSize::FULL) { |
|
|
|
|
bool l = alert.text1.length() > 15; |
|
|
|
|
configFont(p, "Open Sans", l ? 132 : 177, "Bold"); |
|
|
|
|
configFont(p, "Inter", l ? 132 : 177, "Bold"); |
|
|
|
|
p.drawText(QRect(0, r.y() + (l ? 240 : 270), width(), 600), Qt::AlignHCenter | Qt::TextWordWrap, alert.text1); |
|
|
|
|
configFont(p, "Open Sans", 88, "Regular"); |
|
|
|
|
configFont(p, "Inter", 88, "Regular"); |
|
|
|
|
p.drawText(QRect(0, r.height() - (l ? 361 : 420), width(), 300), Qt::AlignHCenter | Qt::TextWordWrap, alert.text2); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|