fancy icons

This commit is contained in:
KikooDX 2021-05-26 00:29:23 +02:00
parent b4caec6f04
commit db24379558
6 changed files with 17 additions and 4 deletions

View File

@ -24,6 +24,7 @@ set(SOURCES
set(ASSETS
assets/background.png
assets/bar3.png
assets/icons.png
)
set(FLAGS

View File

@ -5,3 +5,6 @@ background.png:
bar3.png:
type: bopti-image
name: bimg_bar3
icons.png:
type: bopti-image
name: bimg_icons

BIN
assets/icons.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 530 B

View File

@ -2,13 +2,18 @@
#include <gint/display.h>
extern bopti_image_t bimg_bar3;
extern bopti_image_t bimg_icons;
#define BAR_WIDTH 16
#define BAR_Y 48
#define BAR_HEIGHT (DHEIGHT - BAR_Y - 16)
#define BAR_BASE_FILL 0.5
#define BAR_WIDTH 16
#define BAR_Y 48
#define BAR_HEIGHT (DHEIGHT - BAR_Y - 16)
#define BAR_BASE_FILL 0.5
#define BAR_ICON_HEIGHT 16
#define BAR_ICON_WIDTH 16
#define BAR_ICON_Y (BAR_Y - BAR_ICON_HEIGHT - 16)
struct Bar {
int id;
int x;
int y;
int height;

View File

@ -22,4 +22,7 @@ bar_draw(struct Bar bar)
for (i = high_y + bar.limit_height; i < low_y; i += 1)
dsubimage(bar.x, i, &bimg_bar3, 0, bar.limit_height,
bimg_bar3.width, 1, DIMAGE_NOCLIP);
/* draw icons */
dsubimage(bar.x, BAR_ICON_Y, &bimg_icons, BAR_ICON_WIDTH * bar.id, 0,
BAR_ICON_WIDTH, BAR_ICON_HEIGHT, DIMAGE_NOCLIP);
}

View File

@ -23,6 +23,7 @@ bar_init(enum BarID bar_id)
}
return (struct Bar){
.id = bar_id,
.x = x,
.y = BAR_Y,
.height = BAR_HEIGHT,