@@ -384,15 +384,13 @@ pub const Element = struct {
384384 elements : ArrayListUnmanaged (TextElement ) = .empty ,
385385 line_height : f32 = 1 ,
386386 text_size : TextSize = .normal ,
387- text_colour : ThemeColour = .normal ,
388387 on_click : Callback = .{ .func = null },
389388 },
390389 checkbox : struct {
391390 checked : bool = false ,
392391 font : * FontInfo = undefined ,
393392 font_name : ? []const u8 = null ,
394393 text_size : TextSize = .normal ,
395- text_colour : ThemeColour = .normal ,
396394 text : []const u8 = "" ,
397395 translated : []const u8 = "" ,
398396 elements : ArrayListUnmanaged (TextElement ) = .empty ,
@@ -2253,11 +2251,6 @@ inline fn draw_label(
22532251 .checkbox = > element .type .checkbox .elements .items ,
22542252 else = > unreachable ,
22552253 };
2256- const text_colour = switch (element .type ) {
2257- .label = > element .type .label .text_colour ,
2258- .checkbox = > element .type .checkbox .text_colour ,
2259- else = > unreachable ,
2260- };
22612254
22622255 const word_spacing = display .text_height * display .scale * text_height .height () / 4.0 ;
22632256
@@ -2326,7 +2319,7 @@ inline fn draw_label(
23262319 }
23272320
23282321 // Only render text if display parameter is provided
2329- const current_colour = text_colour .text (display .theme , element .colour );
2322+ const current_colour = element . style .text (display .theme , element .colour );
23302323 _ = sdl .SDL_SetTextureColorMod (
23312324 item .texture ,
23322325 current_colour .r ,
@@ -4994,6 +4987,7 @@ pub const Display = struct {
49944987 ) (Error || Allocator .Error || Resources .Error )! void {
49954988 _ = try parent .add (allocator , display , .{
49964989 .name = name ,
4990+ .style = .normal ,
49974991 .focus = .accessibility_focus ,
49984992 .rect = .{ .x = 250 , .y = 50 , .width = 500 , .height = 80 },
49994993 .layout = .{ .y = .shrinks , .x = .grows },
@@ -5002,7 +4996,6 @@ pub const Display = struct {
50024996 .text = text ,
50034997 .translated = "" ,
50044998 .text_size = size ,
5005- .text_colour = .normal ,
50064999 } },
50075000 });
50085001 }
0 commit comments