diff options
| author | @syxhe <https://t.me/syxhe> | 2024-08-28 12:37:17 -0500 |
|---|---|---|
| committer | @syxhe <https://t.me/syxhe> | 2024-08-28 12:37:17 -0500 |
| commit | 0aa539f551560df43660943f653374b5dda35f76 (patch) | |
| tree | 0c972341b34e405af8792760bc0c407d1cd8e350 /src/screen.c | |
| parent | d55fa751c2d695c50931fcf5473d6515178e2d7a (diff) | |
Make slots and code look nicer
Diffstat (limited to 'src/screen.c')
| -rw-r--r-- | src/screen.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/screen.c b/src/screen.c index 2f1955e..d6806ad 100644 --- a/src/screen.c +++ b/src/screen.c | |||
| @@ -225,17 +225,19 @@ static int init_slotholder(struct slotholder *slots) { | |||
| 225 | for(size_t i = 0; i < STATIC_ARRSIZE(slots->subslot); i++) { | 225 | for(size_t i = 0; i < STATIC_ARRSIZE(slots->subslot); i++) { |
| 226 | slots->subslot[i] = derwin(slots->slotwin, slots->sloty, slots->slotx/3, 0, slots->slotx/3 * i); | 226 | slots->subslot[i] = derwin(slots->slotwin, slots->sloty, slots->slotx/3, 0, slots->slotx/3 * i); |
| 227 | 227 | ||
| 228 | // This works but I need to figure out how to use box() because it should be nicer | ||
| 229 | int mx = 0, my = 0; | 228 | int mx = 0, my = 0; |
| 230 | getmaxyx(slots->subslot[i], my, mx); | 229 | getmaxyx(slots->subslot[i], my, mx); |
| 231 | 230 | ||
| 232 | mvwcreate_box(slots->subslot[i], 1, 1, my - 2, mx - 2, NULL); | 231 | const int height = my - 2, width = mx - 2; |
| 232 | mvwcreate_box(slots->subslot[i], 1, 1, height, width, NULL); | ||
| 233 | for(int j = 0; j < 3; j++) { | 233 | for(int j = 0; j < 3; j++) { |
| 234 | mvwcreate_box(slots->subslot[i], 2 + (j * ((my - 2) / 3)), ((mx - 2) / 2) - (((mx - 2) / 3) / 2), (my - 2) / 3, (mx - 2) / 3, NULL); | 234 | mvwcreate_box(slots->subslot[i], 2 + (j * (height / 3)), width / 4, height / 3, width / 2, NULL); |
| 235 | } | 235 | } |
| 236 | 236 | ||
| 237 | wnoutrefresh(slots->subslot[i]); | 237 | wnoutrefresh(slots->subslot[i]); |
| 238 | } | 238 | } |
| 239 | |||
| 240 | // Not getting rid of the magic numbers. SUck it | ||
| 239 | 241 | ||
| 240 | return 0; | 242 | return 0; |
| 241 | } | 243 | } |
