commit 5fdf004438aa58f4d4b8fd71782d5c31e913c99d
parent 464147058c41fde2eedc3644b13f89bcd850858f
Author: hhvn <dev@hhvn.uk>
Date: Sun, 20 Nov 2022 00:12:33 +0000
Text-less tabs
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/gui.c b/src/gui.c
@@ -120,9 +120,10 @@ gui_tabs(int x, int y, int w, int h, Tabs *tabs) {
selx = cx;
else
ui_draw_rect(cx, y, tabw, h, col_altbg);
- ui_print(cx + padx + iw, y + pady, col_fg, "%s", tabs->tabs[i].name);
+ if (tabs->tabs[i].name)
+ ui_print(cx + padx + iw, y + pady, col_fg, "%s", tabs->tabs[i].name);
if (tabs->tabs[i].icon)
- ui_draw_texture(*tabs->tabs[i].icon, cx + padx / 2,
+ ui_draw_texture(*tabs->tabs[i].icon, cx + (tabs->tabs[i].name ? padx / 2 : padx),
y + (h - tabs->tabs[i].icon->width) / 2);
ui_draw_rect(cx + tabw - 1, y, 1, h, col_border);
}