  class SignalWidget : public QFrame {
    Q_OBJECT
  
  public:
    SignalWidget(QString text, int strength, QWidget* parent = 0);
    void update(QString text, int strength);
    QLabel label;
    int _strength = 0;
  
  protected:
    void paintEvent(QPaintEvent*) override;
  
 
</s> remove   StatusWidget(QString label, QString msg, QColor c, QWidget* parent = 0);
  void update(QString label, QString msg, QColor c);
 </s> add   StatusWidget(bool has_substatus, QWidget* parent = 0);
  void update(const QString &label, const QColor &c, const QString &msg = ""); </s> remove   QLabel status;
  QLabel substatus;
  QVBoxLayout layout;
 </s> add   QVBoxLayout *layout; </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 SignalWidget::SignalWidget(QString text, int strength, QWidget* parent) : QFrame(parent), _strength(strength) {
  layout.setMargin(0);
  layout.setSpacing(0);
  layout.insertSpacing(0, 45);
 </s> add SignalWidget::SignalWidget(QWidget *parent) : QFrame(parent), _strength(0) {
  layout = new QVBoxLayout();
  layout->setMargin(0);
  layout->setSpacing(0);
  layout->insertSpacing(0, 45);
  SignalWidget(QWidget* parent = 0);
  void update(const QString &text, int strength);
  QLabel *label;
  class SignalWidget : public QFrame {
    Q_OBJECT
  
  public:
  SignalWidget(QWidget* parent = 0);
  void update(const QString &text, int strength);
  QLabel *label;
  SignalWidget(QWidget* parent = 0);
  void update(const QString &text, int strength);
  QLabel *label;
  SignalWidget(QWidget* parent = 0);
  void update(const QString &text, int strength);
  QLabel *label;
    int _strength = 0;
  
  protected:
    void paintEvent(QPaintEvent*) override;
  
keep keep keep keep replace 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.h