        {cereal::ThermalData::NetworkStrength::GOOD, 4},
        {cereal::ThermalData::NetworkStrength::GREAT, 5}};
    const Rect rect = {58, 196, 176, 27};
    const int img_idx = s->scene.thermal.getNetworkType() == cereal::ThermalData::NetworkType::NONE ? 0 : network_strength_map[s->scene.thermal.getNetworkStrength()];
    ui_draw_image(s->vg, rect, s->img_network[img_idx], 1.0f);
  }
  
  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};
 
</s> remove   const Rect rect = {58, 196, 176, 27};
 </s> add  </s> remove   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);
 </s> add   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); </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_rect(s->vg, 0, 0, sbr_w, s->fb_h, color);
 </s> add   ui_fill_rect(s->vg, {0, 0, sbr_w, s->fb_h}, color); </s> remove   ui_draw_rect(s->vg, metric_x, metric_y, metric_w, metric_h,
               severity > 0 ? COLOR_WHITE : COLOR_WHITE_ALPHA(85), 20, 2);
 </s> add   const Rect rect = {30, 338 + y_offset, 240, message_str ? strchr(message_str, '\n') ? 124 : 100 : 148};
  ui_draw_rect(s->vg, rect, severity > 0 ? COLOR_WHITE : COLOR_WHITE_ALPHA(85), 2, 20.);
  ui_draw_image(s->vg, {58, 196, 176, 27}, s->img_network[img_idx], 1.0f);
        {cereal::ThermalData::NetworkStrength::GOOD, 4},
        {cereal::ThermalData::NetworkStrength::GREAT, 5}};
    const Rect rect = {58, 196, 176, 27};
    const int img_idx = s->scene.thermal.getNetworkType() == cereal::ThermalData::NetworkType::NONE ? 0 : network_strength_map[s->scene.thermal.getNetworkStrength()];
  ui_draw_image(s->vg, {58, 196, 176, 27}, s->img_network[img_idx], 1.0f);
  }
  
  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};
keep keep keep keep 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