    )");
    setLayout(layout);
  }
  
  void Sidebar::update(const UIState &s){
    static std::map<NetStatus, std::pair<QString, QColor>> connectivity_map = {
      {NET_ERROR, {"CONNECT\nERROR", COLOR_DANGER}},
      {NET_CONNECTED, {"CONNECT\nONLINE", COLOR_GOOD}},
      {NET_DISCONNECTED, {"CONNECT\nOFFLINE", COLOR_WARNING}},
    };
 
</s> remove     {NET_ERROR, {"CONNECT\nERROR", COLOR_DANGER}},
    {NET_CONNECTED, {"CONNECT\nONLINE", COLOR_GOOD}},
    {NET_DISCONNECTED, {"CONNECT\nOFFLINE", COLOR_WARNING}},
 </s> add       {NET_ERROR, {"CONNECT\nERROR", COLOR_DANGER}},
      {NET_CONNECTED, {"CONNECT\nONLINE", COLOR_GOOD}},
      {NET_DISCONNECTED, {"CONNECT\nOFFLINE", COLOR_WARNING}}, </s> remove   connect->update(net_params.first, "", net_params.second);
 </s> add   connect->update(net_params.first, net_params.second); </s> remove   setLayout(&layout);
 </s> add   setLayout(layout); </s> remove   setLayout(&layout);
 </s> add   setLayout(layout);
void Sidebar::update(const UIState &s) {
    )");
    setLayout(layout);
  }
  
void Sidebar::update(const UIState &s) {
    static std::map<NetStatus, std::pair<QString, QColor>> connectivity_map = {
      {NET_ERROR, {"CONNECT\nERROR", COLOR_DANGER}},
      {NET_CONNECTED, {"CONNECT\nONLINE", COLOR_GOOD}},
      {NET_DISCONNECTED, {"CONNECT\nOFFLINE", COLOR_WARNING}},
    };
keep keep keep keep 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