@@ -245,7 +245,6 @@ pub const ElementType = enum {
245245 text_input ,
246246 rectangle ,
247247 button ,
248- button_bar ,
249248 progress_bar ,
250249 expander ,
251250};
@@ -378,15 +377,15 @@ pub const Element = struct {
378377 on_click : Callback = .{ .func = null },
379378 },
380379 checkbox : struct {
380+ checked : bool = false ,
381381 font : * FontInfo = undefined ,
382382 font_name : ? []const u8 = null ,
383- checked : bool = false ,
384- translated : [] const u8 = "" ,
383+ text_size : TextSize = .normal ,
384+ text_colour : ThemeColour = .normal ,
385385 text : []const u8 = "" ,
386+ translated : []const u8 = "" ,
386387 elements : ArrayListUnmanaged (TextElement ) = .empty ,
387388 line_height : f32 = 1 ,
388- text_size : TextSize = .normal ,
389- text_colour : ThemeColour = .normal ,
390389 on_texture : ? * TextureInfo = null ,
391390 off_texture : ? * TextureInfo = null ,
392391 on_change : Callback = .{ .func = null },
@@ -430,7 +429,6 @@ pub const Element = struct {
430429 on_click : Callback = .{ .func = null },
431430 toggle : ToggleState = .no_toggle ,
432431 },
433- button_bar : struct {},
434432 progress_bar : struct {
435433 progress : f32 = 0 ,
436434 },
@@ -527,9 +525,6 @@ pub const Element = struct {
527525 display .release_texture_resource (allocator , texture );
528526 }
529527 },
530- .button_bar = > {
531- //
532- },
533528 }
534529 }
535530
@@ -1333,7 +1328,6 @@ pub const Element = struct {
13331328 },
13341329 .progress_bar = > draw_progress_bar (element , display , parent_scroll_offset , parent_clip ),
13351330 .expander = > {},
1336- else = > {},
13371331 }
13381332
13391333 // Draw a border around an element if a border is specified, or
@@ -1968,7 +1962,7 @@ pub const Element = struct {
19681962 return ;
19691963 }
19701964 },
1971- .button_bar , . progress_bar , .text_input , .rectangle , .expander = > {},
1965+ .progress_bar , .text_input , .rectangle , .expander = > {},
19721966 }
19731967 }
19741968
@@ -4227,7 +4221,7 @@ pub const Display = struct {
42274221 .panel = > if (is_under_cursor and element .type .panel .on_click .func != null ) {
42284222 return element ;
42294223 },
4230- .button_bar , . rectangle , .progress_bar , .expander = > {},
4224+ .rectangle , .progress_bar , .expander = > {},
42314225 }
42324226 } else if (query == .scrollable ) {
42334227 //debug("check cursor scrollable {s} {s}", .{ @tagName(element.type), element.name });
@@ -4588,7 +4582,7 @@ pub const Display = struct {
45884582 .sprite = > try found .chosen (display , gpa ),
45894583 .checkbox = > try found .chosen (display , gpa ),
45904584 .text_input = > found .selected (display , gpa ),
4591- .rectangle , .button_bar , . progress_bar , .expander = > {
4585+ .rectangle , .progress_bar , .expander = > {
45924586 // Not clickable
45934587 },
45944588 }
@@ -4983,7 +4977,6 @@ pub const Display = struct {
49834977 .progress_bar = > try setup_progress_bar (self , allocator , element ),
49844978 .expander = > try setup_expander (self , allocator , element ),
49854979 .text_input = > try setup_text_input (self , allocator , element ),
4986- else = > unreachable ,
49874980 }
49884981 }
49894982};
0 commit comments