From 676cce6809a82a9e0251dc04bddb9804de54a736 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Tue, 16 Feb 2021 23:19:36 -0500 Subject: window borders --- src/user/popups/info.c | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) (limited to 'src/user/popups/info.c') diff --git a/src/user/popups/info.c b/src/user/popups/info.c index 58903c8..9a24ad5 100644 --- a/src/user/popups/info.c +++ b/src/user/popups/info.c @@ -8,12 +8,9 @@ #include #include -#define BORDER_SIZE 2 -//includes border -#define PADDING 8 +#define PADDING 6 #define FONT "berry" -#define BORDER_COLOR 0x10 #define BG_COLOR 0x07 #define FG_COlOR 0x10 @@ -49,19 +46,8 @@ void info_popup(struct popup *into, const char *msg, uint8_t fg, uint8_t bg) { uint8_t *const pixbuf = get_block(pitch * height); - for (uint32_t i = 0; i < pitch * BORDER_SIZE; ++i) - pixbuf[i] = BORDER_COLOR; - for (uint32_t y = BORDER_SIZE; y < height - BORDER_SIZE; ++y) { - for (uint32_t x = 0; x < BORDER_SIZE; ++x) - pixbuf[y * pitch + x] = BORDER_COLOR; - for (uint32_t x = pitch - BORDER_SIZE; x < pitch; ++x) - pixbuf[y * pitch + x] = BORDER_COLOR; - } - for (uint32_t i = 0; i < pitch * BORDER_SIZE; ++i) - pixbuf[(height - BORDER_SIZE) * pitch + i] = BORDER_COLOR; - - for (uint32_t y = BORDER_SIZE; y < height - BORDER_SIZE; ++y) - for (uint32_t x = BORDER_SIZE; x < pitch - BORDER_SIZE; ++x) + for (uint32_t y = 0; y < height; ++y) + for (uint32_t x = 0; x < pitch; ++x) pixbuf[y * pitch + x] = BG_COLOR; uint32_t my = 0; @@ -72,12 +58,8 @@ void info_popup(struct popup *into, const char *msg, uint8_t fg, uint8_t bg) { ++my; mx = 0; } - else { - //syslogf("calling put_char(0x%x, '%c', pixbuf + %u, %u, 0x%2x, 0x%2x)", info_font, *msg, - // (my * info_font->space_height + PADDING) * pitch + mx * info_font->space_width + PADDING, - // pitch, BG_COLOR, FG_COlOR); + else put_char(info_font, *msg, pixbuf + (my * info_font->space_height + PADDING) * pitch + mx++ * info_font->space_width + PADDING, pitch, BG_COLOR, FG_COlOR); - } } into->pixbuf = pixbuf; -- cgit v1.2.3