diff options
| author | iamcheeseman <[hidden email]> | 2026-03-01 16:31:51 -0500 |
|---|---|---|
| committer | iamcheeseman <[hidden email]> | 2026-03-01 16:31:51 -0500 |
| commit | b40029a0f0c96f33310880b4d7239ce8fd93a5b9 (patch) | |
| tree | 8b7510f1a12c48185fa0bbec11edb1db8f0ff61b /src/tsar.c | |
| parent | 5b52739d9e1740f102cea7895cf8e7e51d925573 (diff) | |
| parent | 08bfea4f3587143323a948ab96c91f863cece7de (diff) | |
Merge branch 'master' of ssh://codeberg.org/iamcheeseman/tsarbar
Diffstat (limited to 'src/tsar.c')
| -rw-r--r-- | src/tsar.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -97,6 +97,9 @@ void init_x(void) { gc = XCreateGC(display, win, 0, NULL); XSetForeground(display, gc, 0xFFFFFF); + for (int i = 0; i < 32; i++) { + XLowerWindow(display, win); + } XFlush(display); } @@ -128,10 +131,11 @@ void draw_comp_set(float pos_ratio, comp_t **set, int size) { } int x = (bar_width - width) * pos_ratio; + int y = (bar_height - font->height) / 2; for (int i = 0; i < size; i++) { comp_t *comp = set[i]; - draw_text(comp->data, x, 0); + draw_text(comp->data, x, y); x += font->max_advance_width * strlen(comp->data); } } @@ -148,12 +152,6 @@ int main(void) { XClearWindow(display, win); XResizeWindow(display, win, bar_width, bar_height); - int x = 0; - for (int i = 0; i < left_size; i++) { - comp_t* comp = comps_left[i]; - draw_text(comp->data, x, 0); - x += font->max_advance_width * strlen(comp->data); - } draw_comp_set(0, comps_left, left_size); draw_comp_set(0.5, comps_center, center_size); draw_comp_set(1, comps_right, right_size); |
