From d55fa751c2d695c50931fcf5473d6515178e2d7a Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Tue, 27 Aug 2024 23:17:56 -0500 Subject: More box --- src/screen.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/screen.c') diff --git a/src/screen.c b/src/screen.c index 44269ae..2f1955e 100644 --- a/src/screen.c +++ b/src/screen.c @@ -211,13 +211,12 @@ static int mvwcreate_box(WINDOW *win, int y, int x, int height, int width, const mvwhline(win, y + height - 1, x, realchars[1], width) - 1; // Corners - mvwaddch(win, y, x, realchars[2]); - mvwaddch(win, y, x + width - 1, realchars[3]); - mvwaddch(win, y + height - 1, x, realchars[4]); - mvwaddch(win, y + height - 1, x + width - 1, realchars[5]); + mvwaddch(win, y, x, realchars[2]); // Upper left corner + mvwaddch(win, y, x + width - 1, realchars[3]); // Upper right corner + mvwaddch(win, y + height - 1, x, realchars[4]); // Lower left corner + mvwaddch(win, y + height - 1, x + width - 1, realchars[5]); // Lower right corner // Yeah I'm not happy about the magic numbers either, but this combo of shit makes the box draw correctly - return 0; } @@ -231,6 +230,9 @@ static int init_slotholder(struct slotholder *slots) { getmaxyx(slots->subslot[i], my, mx); mvwcreate_box(slots->subslot[i], 1, 1, my - 2, mx - 2, NULL); + for(int j = 0; j < 3; j++) { + mvwcreate_box(slots->subslot[i], 2 + (j * ((my - 2) / 3)), ((mx - 2) / 2) - (((mx - 2) / 3) / 2), (my - 2) / 3, (mx - 2) / 3, NULL); + } wnoutrefresh(slots->subslot[i]); } -- cgit v1.2.3