]> git.sur5r.net Git - i3/i3/commitdiff
i3bar: rename a variable
authorshdown <shdownnine@gmail.com>
Sat, 21 Mar 2015 16:17:05 +0000 (19:17 +0300)
committershdown <shdownnine@gmail.com>
Sat, 21 Mar 2015 16:17:05 +0000 (19:17 +0300)
Give it a more meaningful name.

i3bar/src/xcb.c

index 79ac211d39d717827d33b3c33221a9fbc00cf38f..fc19834927fdf3ca7aa318f236834cdbd79be13c 100644 (file)
@@ -1736,7 +1736,7 @@ void reconfig_windows(bool redraw_bars) {
  */
 void draw_bars(bool unhide) {
     DLOG("Drawing Bars...\n");
-    int i = 0;
+    int workspace_width = 0;
 
     refresh_statusline();
 
@@ -1767,7 +1767,7 @@ void draw_bars(bool unhide) {
             i3_ws *ws_walk;
             TAILQ_FOREACH(ws_walk, outputs_walk->workspaces, tailq) {
                 DLOG("Drawing Button for WS %s at x = %d, len = %d\n",
-                     i3string_as_utf8(ws_walk->name), i, ws_walk->name_width);
+                     i3string_as_utf8(ws_walk->name), workspace_width, ws_walk->name_width);
                 uint32_t fg_color = colors.inactive_ws_fg;
                 uint32_t bg_color = colors.inactive_ws_bg;
                 uint32_t border_color = colors.inactive_ws_border;
@@ -1795,7 +1795,7 @@ void draw_bars(bool unhide) {
                               outputs_walk->bargc,
                               mask,
                               vals_border);
-                xcb_rectangle_t rect_border = {i,
+                xcb_rectangle_t rect_border = {workspace_width,
                                                logical_px(1),
                                                ws_walk->name_width + logical_px(10),
                                                font.height + logical_px(4)};
@@ -1809,7 +1809,7 @@ void draw_bars(bool unhide) {
                               outputs_walk->bargc,
                               mask,
                               vals);
-                xcb_rectangle_t rect = {i + logical_px(1),
+                xcb_rectangle_t rect = {workspace_width + logical_px(1),
                                         2 * logical_px(1),
                                         ws_walk->name_width + logical_px(8),
                                         font.height + logical_px(2)};
@@ -1820,8 +1820,8 @@ void draw_bars(bool unhide) {
                                         &rect);
                 set_font_colors(outputs_walk->bargc, fg_color, bg_color);
                 draw_text(ws_walk->name, outputs_walk->buffer, outputs_walk->bargc,
-                          i + logical_px(5), 3 * logical_px(1), ws_walk->name_width);
-                i += logical_px(10) + ws_walk->name_width + logical_px(1);
+                          workspace_width + logical_px(5), 3 * logical_px(1), ws_walk->name_width);
+                workspace_width += logical_px(10) + ws_walk->name_width + logical_px(1);
             }
         }
 
@@ -1835,7 +1835,7 @@ void draw_bars(bool unhide) {
                           outputs_walk->bargc,
                           mask,
                           vals_border);
-            xcb_rectangle_t rect_border = {i, 1, binding.width + 10, font.height + 4};
+            xcb_rectangle_t rect_border = {workspace_width, 1, binding.width + 10, font.height + 4};
             xcb_poly_fill_rectangle(xcb_connection,
                                     outputs_walk->buffer,
                                     outputs_walk->bargc,
@@ -1847,7 +1847,7 @@ void draw_bars(bool unhide) {
                           outputs_walk->bargc,
                           mask,
                           vals);
-            xcb_rectangle_t rect = {i + 1, 2, binding.width + 8, font.height + 2};
+            xcb_rectangle_t rect = {workspace_width + 1, 2, binding.width + 8, font.height + 2};
             xcb_poly_fill_rectangle(xcb_connection,
                                     outputs_walk->buffer,
                                     outputs_walk->bargc,
@@ -1855,10 +1855,10 @@ void draw_bars(bool unhide) {
                                     &rect);
 
             set_font_colors(outputs_walk->bargc, fg_color, bg_color);
-            draw_text(binding.name, outputs_walk->buffer, outputs_walk->bargc, i + 5, 3, binding.width);
+            draw_text(binding.name, outputs_walk->buffer, outputs_walk->bargc, workspace_width + 5, 3, binding.width);
 
             unhide = true;
-            i += logical_px(10) + binding.width + logical_px(1);
+            workspace_width += logical_px(10) + binding.width + logical_px(1);
         }
 
         if (!TAILQ_EMPTY(&statusline_head)) {
@@ -1882,7 +1882,8 @@ void draw_bars(bool unhide) {
                 traypx += logical_px(2);
 
             int edge_offset = logical_px(4);
-            int visible_statusline_width = MIN(statusline_width, outputs_walk->rect.w - i - traypx - 2*edge_offset);
+            int visible_statusline_width = MIN(statusline_width,
+                                               outputs_walk->rect.w - workspace_width - traypx - 2*edge_offset);
 
             xcb_copy_area(xcb_connection,
                           statusline_pm,
@@ -1893,7 +1894,7 @@ void draw_bars(bool unhide) {
                           (int16_t)visible_statusline_width, (int16_t)bar_height);
         }
 
-        i = 0;
+        workspace_width = 0;
     }
 
     /* Assure the bar is hidden/unhidden according to the specified hidden_state and mode */