diff options
| author | bakkeby <[email protected]> | 2020-07-15 14:10:47 +0200 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2020-07-15 14:10:47 +0200 |
| commit | aa70728d0049f771820f17cfca4488768cf57cef (patch) | |
| tree | 6c04dd37b98a70b6f9aedf15e9ece315f7d89933 /patch/bar_taggrid.c | |
| parent | f2da4d20d9a79070863972423ca964cf65342ba7 (diff) | |
| download | dwm-flexipatch-aa70728d0049f771820f17cfca4488768cf57cef.tar.gz dwm-flexipatch-aa70728d0049f771820f17cfca4488768cf57cef.zip | |
Adding BarWidthArg, BarDrawArg, BarClickArg to keep the method signatures static
Diffstat (limited to 'patch/bar_taggrid.c')
| -rw-r--r-- | patch/bar_taggrid.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/patch/bar_taggrid.c b/patch/bar_taggrid.c index 4fa98d7..78b3d1c 100644 --- a/patch/bar_taggrid.c +++ b/patch/bar_taggrid.c @@ -1,11 +1,11 @@ int -width_taggrid(Monitor *m, int max_width) +width_taggrid(Monitor *m, BarWidthArg *a) { return (bh / 2) * (LENGTH(tags) / tagrows + ((LENGTH(tags) % tagrows > 0) ? 1 : 0)); } int -draw_taggrid(Monitor *m, int x_pos, int w) +draw_taggrid(Monitor *m, BarDrawArg *a) { unsigned int x, y, h, max_x, columns, occ = 0; int invert, i,j, k; @@ -15,7 +15,7 @@ draw_taggrid(Monitor *m, int x_pos, int w) occ |= c->tags; h = bh / tagrows; - x = max_x = x_pos; + x = max_x = a->x; y = 0; columns = LENGTH(tags) / tagrows + ((LENGTH(tags) % tagrows > 0) ? 1 : 0); @@ -24,7 +24,7 @@ draw_taggrid(Monitor *m, int x_pos, int w) /* We will draw LENGTH(tags) squares in tagraws raws. */ for (j = 0, i = 0; j < tagrows; j++) { - x = x_pos; + x = a->x; for (k = 0; k < columns && i < LENGTH(tags); k++, i++) { invert = m->tagset[m->seltags] & 1 << i ? 0 : 1; @@ -51,12 +51,12 @@ draw_taggrid(Monitor *m, int x_pos, int w) } int -click_taggrid(Monitor *m, Arg *arg, int rel_x, int rel_y, int rel_w, int rel_h) +click_taggrid(Monitor *m, Arg *arg, BarClickArg *a) { unsigned int i, columns; columns = LENGTH(tags) / tagrows + ((LENGTH(tags) % tagrows > 0) ? 1 : 0); - i = (rel_x - 0) / (bh / tagrows) + columns * (rel_y / (bh / tagrows)); + i = (a->rel_x - 0) / (bh / tagrows) + columns * (a->rel_y / (bh / tagrows)); if (i >= LENGTH(tags)) { i = LENGTH(tags) - 1; } |
