  
  #include "selfdrive/ui/qt/qt_window.h"
  #include "selfdrive/common/util.h"
  #include "selfdrive/hardware/hw.h"
  
  void configFont(QPainter &p, QString family, int size, int weight) {
    QFont f(family);
    f.setPixelSize(size);
    f.setWeight(weight);
    p.setFont(f);
  }
  
  void Sidebar::drawMetric(QPainter &p, const QString &label, const QString &val, QColor c, int y) {
    const QRect rect = {30, y, 240, val.isEmpty() ? (label.contains("\n") ? 124 : 100) : 148};
  
    p.setPen(Qt::NoPen);
 
</s> remove #include "selfdrive/ui/qt/qt_window.h"
 </s> add #include "selfdrive/ui/qt/util.h" </s> remove   QColor bg;
  QLabel *title, *msg;
  QVBoxLayout *layout;

  void updateAlert(const QString &text1, const QString &text2, float blink_rate,
 </s> add   void stopSounds();
  void playSound(AudibleAlert alert);
  void updateAlert(const QString &t1, const QString &t2, float blink_rate, </s> remove   setVisible(size != cereal::ControlsState::AlertSize::NONE);
  repaint();
 </s> add   update(); </s> remove   p.setBrush(QBrush(bg));
 </s> add   static std::map<cereal::ControlsState::AlertSize, const int> alert_sizes = {
    {cereal::ControlsState::AlertSize::NONE, 0},
    {cereal::ControlsState::AlertSize::SMALL, 271},
    {cereal::ControlsState::AlertSize::MID, 420},
    {cereal::ControlsState::AlertSize::FULL, height()},
  };
  int h = alert_sizes[alert_size];
  if (h == 0) {
    return;
  }

  QRect r = QRect(0, height() - h, width(), h);

  // draw background + gradient
#include "selfdrive/ui/qt/util.h"
  
  #include "selfdrive/ui/qt/qt_window.h"
  #include "selfdrive/common/util.h"
  #include "selfdrive/hardware/hw.h"
#include "selfdrive/ui/qt/util.h"
#include "selfdrive/ui/qt/util.h"
#include "selfdrive/ui/qt/util.h"
#include "selfdrive/ui/qt/util.h"
#include "selfdrive/ui/qt/util.h"
#include "selfdrive/ui/qt/util.h"
#include "selfdrive/ui/qt/util.h"
  
  void Sidebar::drawMetric(QPainter &p, const QString &label, const QString &val, QColor c, int y) {
    const QRect rect = {30, y, 240, val.isEmpty() ? (label.contains("\n") ? 124 : 100) : 148};
  
    p.setPen(Qt::NoPen);
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep keep
 match nvg onroad alerts (#20854) 
selfdrive/ui/qt/sidebar.cc