selection in targets view

This commit is contained in:
Ryan Fleury
2024-09-27 14:46:22 -07:00
parent 7362f8ef60
commit 52b2cbc17a
2 changed files with 12 additions and 5 deletions
+3 -3
View File
@@ -8597,7 +8597,7 @@ rd_append_value_strings_from_eval(Arena *arena, EV_StringFlags flags, U32 defaul
if(!did_content && ptee_has_content && (flags & EV_StringFlag_ReadOnlyDisplayRules)) if(!did_content && ptee_has_content && (flags & EV_StringFlag_ReadOnlyDisplayRules))
{ {
did_content = 1; did_content = 1;
if(depth < 3) if(depth < 4)
{ {
E_Expr *deref_expr = e_expr_ref_deref(scratch.arena, eval.expr); E_Expr *deref_expr = e_expr_ref_deref(scratch.arena, eval.expr);
E_Eval deref_eval = e_eval_from_expr(scratch.arena, deref_expr); E_Eval deref_eval = e_eval_from_expr(scratch.arena, deref_expr);
@@ -8705,7 +8705,7 @@ rd_append_value_strings_from_eval(Arena *arena, EV_StringFlags flags, U32 defaul
} }
// rjf: build contents // rjf: build contents
if(depth < 3) if(depth < 4)
{ {
for(U64 idx = 0; idx < array_count && max_size > space_taken; idx += 1) for(U64 idx = 0; idx < array_count && max_size > space_taken; idx += 1)
{ {
@@ -8758,7 +8758,7 @@ rd_append_value_strings_from_eval(Arena *arena, EV_StringFlags flags, U32 defaul
} }
// rjf: content // rjf: content
if(depth < 3) if(depth < 4)
{ {
E_MemberArray data_members = e_type_data_members_from_key(scratch.arena, e_type_unwrap(eval.type_key)); E_MemberArray data_members = e_type_data_members_from_key(scratch.arena, e_type_unwrap(eval.type_key));
for(U64 member_idx = 0; member_idx < data_members.count && max_size > space_taken; member_idx += 1) for(U64 member_idx = 0; member_idx < data_members.count && max_size > space_taken; member_idx += 1)
+9 -2
View File
@@ -2385,7 +2385,9 @@ rd_watch_view_build(RD_WatchViewState *ewv, RD_WatchViewFlags flags, String8 roo
{ {
if(entity->kind == RD_EntityKind_Target) if(entity->kind == RD_EntityKind_Target)
{ {
rd_cmd(RD_CmdKind_SelectEntity, .entity = rd_handle_from_entity(entity)); rd_cmd(sig.event_flags & OS_Modifier_Ctrl && entity->disabled ? RD_CmdKind_EnableEntity :
sig.event_flags & OS_Modifier_Ctrl && !entity->disabled ? RD_CmdKind_DisableEntity :
RD_CmdKind_SelectEntity, .entity = rd_handle_from_entity(entity));
} }
} }
} }
@@ -2401,7 +2403,12 @@ rd_watch_view_build(RD_WatchViewState *ewv, RD_WatchViewFlags flags, String8 roo
{ {
UI_FocusHot(row_selected && selection_tbl.min.x <= ctrl_idx+1 && ctrl_idx+1 <= selection_tbl.max.x ? UI_FocusKind_On : UI_FocusKind_Off) UI_FocusHot(row_selected && selection_tbl.min.x <= ctrl_idx+1 && ctrl_idx+1 <= selection_tbl.max.x ? UI_FocusKind_On : UI_FocusKind_Off)
{ {
if(ui_clicked(rd_icon_buttonf(rd_cmd_kind_info_table[ctrl->kind].icon_kind, 0, "###row_ctrl_%I64x", idx))) RD_IconKind icon_kind = rd_cmd_kind_info_table[ctrl->kind].icon_kind;
if(ctrl->kind == RD_CmdKind_SelectEntity)
{
icon_kind = entity->disabled ? RD_IconKind_CheckHollow : RD_IconKind_CheckFilled;
}
if(ui_clicked(rd_icon_buttonf(icon_kind, 0, "###row_ctrl_%I64x", idx)))
{ {
rd_cmd(ctrl->kind, .entity = rd_handle_from_entity(entity)); rd_cmd(ctrl->kind, .entity = rd_handle_from_entity(entity));
} }