pcadmin/src/bar/draw.c

16 lines
386 B
C
Raw Normal View History

2021-04-16 11:08:47 +02:00
#include "bar.h"
2021-05-24 11:07:56 +02:00
#include <gint/display.h>
2021-04-16 11:08:47 +02:00
void
bar_draw(struct Bar bar)
{
2021-05-24 11:07:56 +02:00
const int height = bar.fill * (float)bar.height;
const int y = bar.y + bar.height - height;
/* borders */
2021-05-24 12:11:04 +02:00
drect_border(bar.x - 1, bar.y - 1, bar.x + BAR_WIDTH + 1,
bar.y + bar.height + 1, C_WHITE, 2, C_BLACK);
2021-05-24 11:19:21 +02:00
/* fill */
drect(bar.x, y, bar.x + BAR_WIDTH, y + height, C_RGB(0, 32, 32));
2021-04-16 11:08:47 +02:00
}