diff options
author | Benji Dial <benji6283@gmail.com> | 2021-02-16 23:19:36 -0500 |
---|---|---|
committer | Benji Dial <benji6283@gmail.com> | 2021-02-16 23:19:36 -0500 |
commit | 676cce6809a82a9e0251dc04bddb9804de54a736 (patch) | |
tree | cc312ac9eaf10f8e7e0009f0c220505e0109ca8c /src/user | |
parent | ab4e1cfc8c587e4144d847bbd41307eff03130b2 (diff) | |
download | portland-os-676cce6809a82a9e0251dc04bddb9804de54a736.tar.gz |
window borders
Diffstat (limited to 'src/user')
-rw-r--r-- | src/user/popups/info.c | 26 |
1 files changed, 4 insertions, 22 deletions
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 <stdint.h> #include <stdarg.h> -#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; |