aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xexamplebar.sh2
-rw-r--r--src/tsar.c9
2 files changed, 3 insertions, 8 deletions
diff --git a/examplebar.sh b/examplebar.sh
index 7ec4152..4f32786 100755
--- a/examplebar.sh
+++ b/examplebar.sh
@@ -2,7 +2,7 @@
# Put any monospace font here
./tsarc config font "Liberation Mono:style=Regular:size=9"
-./tsarc config height 14
+./tsarc config height 16
./tsarc create test_comp
./tsarc set test_comp -text "Testing spaces"
diff --git a/src/tsar.c b/src/tsar.c
index 2d9d041..8673aff 100644
--- a/src/tsar.c
+++ b/src/tsar.c
@@ -128,10 +128,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 +149,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);