    QPainter p(this);
    p.setRenderHint(QPainter::Antialiasing, true);
    p.setPen(Qt::NoPen);
    p.setBrush(Qt::white);
    for (int i = 0; i < 5 ; i++){
      if(i == _strength){
        p.setPen(Qt::NoPen);
        p.setBrush(Qt::darkGray);
      }
      p.drawEllipse(QRectF(_dotspace * i, _top, _dia, _dia));
    }
 
</s> remove void SignalWidget::paintEvent(QPaintEvent *e){
 </s> add void SignalWidget::paintEvent(QPaintEvent *e) { </s> remove void SignalWidget::update(QString text, int strength){
  label.setText(text);
  _strength = strength;
 </s> add void SignalWidget::update(const QString &text, int strength) {
  label->setText(text);
  if (_strength != strength) {
    _strength = strength;
    repaint();
  } </s> remove   setLayout(&layout);
 </s> add   setLayout(layout); </s> remove   setLayout(&layout);
 </s> add   setLayout(layout); </s> remove void StatusWidget::paintEvent(QPaintEvent *e){
 </s> add void StatusWidget::paintEvent(QPaintEvent *e) {
  for (int i = 0; i < 5; i++) {
    if (i == _strength) {
    QPainter p(this);
    p.setRenderHint(QPainter::Antialiasing, true);
    p.setPen(Qt::NoPen);
    p.setBrush(Qt::white);
  for (int i = 0; i < 5; i++) {
    if (i == _strength) {
  for (int i = 0; i < 5; i++) {
    if (i == _strength) {
        p.setPen(Qt::NoPen);
        p.setBrush(Qt::darkGray);
      }
      p.drawEllipse(QRectF(_dotspace * i, _top, _dia, _dia));
    }
keep keep keep keep replace replace keep keep keep keep keep
 Sidebar: update text and color in one place (#20777)

* do not set text&color in ctor

* cleanup

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> 
selfdrive/ui/qt/sidebar.cc