diff libui/ui/debug.c @ 174:6992085d47fd

ui: major theme overhaul, closes #2509 @1h - The font does not contain a color anymore, - Add a new color argument to font_render, - Theme are stored `const` in UI elements to promise no modifications, - Also make all <ui>_draw function to take a const widget too.
author David Demelier <markand@malikania.fr>
date Thu, 22 Oct 2020 15:16:43 +0200
parents aab824406d3d
children
line wrap: on
line diff
--- a/libui/ui/debug.c	Wed Oct 21 12:50:11 2020 +0200
+++ b/libui/ui/debug.c	Thu Oct 22 15:16:43 2020 +0200
@@ -56,22 +56,17 @@
 		return;
 
 	char line[DEBUG_LINE_MAX];
-	struct theme *theme;
-	struct font font;
+	const struct theme *theme;
+	struct font *font;
 	struct texture tex;
 	int x, y;
 
 	vsnprintf(line, sizeof (line), fmt, ap);
 
-	/* Get the font and modify its style. */
 	theme = report->theme ? report->theme : theme_default();
+	font = theme->fonts[THEME_FONT_DEBUG];
 
-	/* Update font style. */
-	font_shallow(&font, theme->fonts[THEME_FONT_DEBUG]);
-	font.style = FONT_STYLE_ANTIALIASED;
-	font.color = theme->colors[THEME_COLOR_DEBUG];
-
-	if (!font_render(&font, &tex, line))
+	if (!font_render(font, &tex, line, theme->colors[THEME_COLOR_DEBUG]))
 		return;
 
 	x = theme->padding;