default expansion in eval visualization; apply to scheduler tree

This commit is contained in:
Ryan Fleury
2024-10-14 14:21:12 -07:00
parent 6a297113c5
commit 6fcdce4e0f
5 changed files with 75 additions and 44 deletions
+7 -1
View File
@@ -6657,7 +6657,7 @@ rd_window_frame(RD_Window *ws)
B32 row_is_expanded = ev_expansion_from_key(ev_view, row->key);
if(row_is_expandable)
UI_PrefWidth(ui_em(1.f, 1))
if(ui_pressed(ui_expanderf(row_is_expanded, "###%I64x_%I64x_is_expanded", row->key.parent_hash, row->key.child_id)))
if(ui_pressed(ui_expanderf(row->block->rows_default_expanded ? !row_is_expanded : row_is_expanded, "###%I64x_%I64x_is_expanded", row->key.parent_hash, row->key.child_id)))
{
ev_key_set_expansion(ev_view, row->block->key, row->key, !row_is_expanded);
}
@@ -8654,6 +8654,7 @@ EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(scheduler_machine)
*processes_array = ctrl_entity_array_from_list(arena, &processes);
info.user_data = processes_array;
info.row_count = processes.count;
info.rows_default_expanded = 1;
}
scratch_end(scratch);
return info;
@@ -9071,6 +9072,11 @@ rd_ev_view_rule_expr_expand_info__meta_ctrl_entities(Arena *arena, EV_View *view
}
scratch_end(scratch);
EV_ExpandInfo info = {accel, accel->entities.count};
// TODO(rjf): hack
if(kind == CTRL_EntityKind_Machine)
{
info.rows_default_expanded = 1;
}
return info;
}
+1 -1
View File
@@ -2652,7 +2652,7 @@ rd_watch_view_build(RD_WatchViewState *ewv, RD_WatchViewFlags flags, String8 roo
case CTRL_EntityKind_Process:{slot = RD_RegSlot_Process; rd_regs()->process = ctrl_entity->handle;}break;
case CTRL_EntityKind_Module: {slot = RD_RegSlot_Module; rd_regs()->module = ctrl_entity->handle;}break;
}
UI_PrefWidth(ui_em(2.f, 1.f)) if(ui_pressed(ui_expander(row_expanded, str8_lit("###expanded"))))
UI_PrefWidth(ui_em(2.f, 1.f)) if(ui_pressed(ui_expander(row->block->rows_default_expanded ? !row_expanded : row_expanded, str8_lit("###expanded"))))
{
next_row_expanded = !row_expanded;
}
+4 -4
View File
@@ -44,10 +44,10 @@ struct RD_CodeViewBuildResult
typedef U32 RD_WatchViewFlags;
enum
{
RD_WatchViewFlag_NoHeader = (1<<0),
RD_WatchViewFlag_PrettyNameMembers = (1<<1),
RD_WatchViewFlag_PrettyEntityRows = (1<<2),
RD_WatchViewFlag_DisableCacheLines = (1<<3),
RD_WatchViewFlag_NoHeader = (1<<0),
RD_WatchViewFlag_PrettyNameMembers = (1<<1),
RD_WatchViewFlag_PrettyEntityRows = (1<<2),
RD_WatchViewFlag_DisableCacheLines = (1<<3),
};
typedef enum RD_WatchViewColumnKind