  
  static void draw_battery_icon(UIState *s) {
    int battery_img = s->scene.thermal.getBatteryStatus() == "Charging" ? s->img_battery_charging : s->img_battery;
    const Rect rect = {160, 255, 76, 36};
    ui_draw_rect(s->vg, rect.x + 6, rect.y + 5,
                 ((rect.w - 19) * (s->scene.thermal.getBatteryPercent() * 0.01)), rect.h - 11, COLOR_WHITE);
    ui_draw_image(s->vg, rect, battery_img, 1.0f);
  }
  
  static void draw_network_type(UIState *s) {
    static std::map<cereal::ThermalData::NetworkType, const char *> network_type_map = {
 
</s> remove   ui_draw_image(s->vg, rect, s->img_network[img_idx], 1.0f);
 </s> add   ui_draw_image(s->vg, {58, 196, 176, 27}, s->img_network[img_idx], 1.0f); </s> remove   const Rect rect = {58, 196, 176, 27};
 </s> add  </s> remove     nvgTextBox(s->vg, metric_x + 35, metric_y + (strchr(message_str, '\n') ? 40 : 50), metric_w - 50, message_str, NULL);
 </s> add     nvgTextBox(s->vg, rect.x + 35, rect.y + (strchr(message_str, '\n') ? 40 : 50), rect.w - 50, message_str, NULL); </s> remove   const int metric_x = 30;
  const int metric_y = 338 + y_offset;
  const int metric_w = 240;
  const int metric_h = message_str ? strchr(message_str, '\n') ? 124 : 100 : 148;

 </s> add  </s> remove     ui_draw_text(s->vg, x + w / 2, 242, "N/A", 42 * 2.5, COLOR_WHITE_ALPHA(100), s->font_sans_semibold);
 </s> add     ui_draw_text(s->vg, rect.centerX(), 242, "N/A", 42 * 2.5, COLOR_WHITE_ALPHA(100), s->font_sans_semibold);
  ui_fill_rect(s->vg, {rect.x + 6, rect.y + 5,
              int((rect.w - 19) * s->scene.thermal.getBatteryPercent() * 0.01), rect.h - 11}, COLOR_WHITE);
  
  static void draw_battery_icon(UIState *s) {
    int battery_img = s->scene.thermal.getBatteryStatus() == "Charging" ? s->img_battery_charging : s->img_battery;
    const Rect rect = {160, 255, 76, 36};
  ui_fill_rect(s->vg, {rect.x + 6, rect.y + 5,
              int((rect.w - 19) * s->scene.thermal.getBatteryPercent() * 0.01), rect.h - 11}, COLOR_WHITE);
  ui_fill_rect(s->vg, {rect.x + 6, rect.y + 5,
              int((rect.w - 19) * s->scene.thermal.getBatteryPercent() * 0.01), rect.h - 11}, COLOR_WHITE);
    ui_draw_image(s->vg, rect, battery_img, 1.0f);
  }
  
  static void draw_network_type(UIState *s) {
    static std::map<cereal::ThermalData::NetworkType, const char *> network_type_map = {
keep keep keep keep replace replace keep keep keep keep keep
 Use  Rect as the parameter of draw_rect (#19696)

* Use rect as the parameter of draw_rect

* add function ui_fill_rect

* simplify

* rebase master

* apply review 
selfdrive/ui/sidebar.cc