padding visualization

This commit is contained in:
Ryan Fleury
2024-02-02 16:42:08 -08:00
parent 708517a668
commit 7e589e8cd2
5 changed files with 102 additions and 24 deletions
+1
View File
@@ -771,6 +771,7 @@ enum
DF_EvalVizRowFlag_CanExpand = (1<<0),
DF_EvalVizRowFlag_CanEditValue = (1<<1),
DF_EvalVizRowFlag_Canvas = (1<<2),
DF_EvalVizRowFlag_ExprIsSpecial= (1<<3),
};
typedef struct DF_EvalVizRow DF_EvalVizRow;
+9 -1
View File
@@ -7218,6 +7218,10 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
row->value_ui_rule_spec = value_ui_rule_spec;
row->expand_ui_rule_node = expand_ui_rule_node;
row->expand_ui_rule_spec = expand_ui_rule_spec;
if(block->member && block->member->kind == TG_MemberKind_Padding)
{
row->flags |= DF_EvalVizRowFlag_ExprIsSpecial;
}
if(expandability_required)
{
row->flags |= DF_EvalVizRowFlag_CanExpand;
@@ -7263,7 +7267,11 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
String8List display_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, DF_EvalVizStringFlag_ReadOnlyDisplayRules, parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, default_radix, font, font_size, 500, 0, member_eval, member, &view_rule_table);
String8List edit_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, 0, parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, default_radix, font, font_size, 500, 0, member_eval, member, &view_rule_table);
DF_EvalVizRow *row = df_eval_viz_row_list_push_new(arena, parse_ctx, &list, block, key, member_eval);
row->expr = push_str8_copy(arena, member->name);
if(member->kind == TG_MemberKind_Padding)
{
row->flags |= DF_EvalVizRowFlag_ExprIsSpecial;
}
row->expr = push_str8_copy(arena, member->name);
row->display_value = str8_list_join(arena, &display_strings, 0);
row->edit_value = str8_list_join(arena, &edit_strings, 0);
row->value_ui_rule_node = value_ui_rule_node;
+4 -2
View File
@@ -1238,7 +1238,9 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
{
B32 expr_editing_active = ui_is_focus_active();
B32 is_inherited = (row->inherited_type_key_chain.count != 0);
UI_Font(code_font) UI_TextColor(row->depth > 0 ? df_rgba_from_theme_color(DF_ThemeColor_WeakText) : ui_top_text_color())
UI_Font(code_font) UI_TextColor((row->flags & DF_EvalVizRowFlag_ExprIsSpecial) ?
df_rgba_from_theme_color(DF_ThemeColor_Highlight0) :
row->depth > 0 ? df_rgba_from_theme_color(DF_ThemeColor_WeakText) : ui_top_text_color())
{
if(is_inherited)
{
@@ -1251,7 +1253,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
{
matches = fuzzy_match_find(scratch.arena, filter, row->expr);
}
sig = df_line_editf((DF_LineEditFlag_CodeContents|
sig = df_line_editf((DF_LineEditFlag_CodeContents*(!(row->flags & DF_EvalVizRowFlag_ExprIsSpecial))|
DF_LineEditFlag_NoBackground*(!is_inherited)|
DF_LineEditFlag_DisableEdit*(!can_edit_expr)|
DF_LineEditFlag_Expander*!!(row->flags & DF_EvalVizRowFlag_CanExpand)|