@@ -995,10 +995,13 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row)
995995 // but does not evaluate them, from e.g. "targets", which uses the group of target
996996 // cfgs, and the evaluations are of the targets themselves.
997997 //
998- B32 row_eval_matches_group = 0 ;
998+ B32 row_cfg_eval_matches_group = 0 ;
999999 RD_Cfg * evalled_cfg = rd_cfg_from_eval_space (info .eval .space );
1000+ B32 row_entity_eval_matches_group = 0 ;
1001+ CTRL_Entity * evalled_entity = (info .eval .space .kind == RD_EvalSpaceKind_MetaCtrlEntity ? rd_ctrl_entity_from_eval_space (info .eval .space ) : & ctrl_entity_nil );
10001002 {
1001- row_eval_matches_group = (evalled_cfg == info .group_cfg_child );
1003+ row_cfg_eval_matches_group = (evalled_cfg == info .group_cfg_child );
1004+ row_entity_eval_matches_group = (evalled_entity == info .group_entity );
10021005 }
10031006
10041007 // rjf: determine view ui rule
@@ -1013,7 +1016,7 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row)
10131016 if (0 ){}
10141017
10151018 // rjf: cfg rows
1016- else if ((info .eval .space .kind == RD_EvalSpaceKind_MetaCfg && row_eval_matches_group && info .group_cfg_parent == & rd_nil_cfg ) ||
1019+ else if ((info .eval .space .kind == RD_EvalSpaceKind_MetaCfg && row_cfg_eval_matches_group && info .group_cfg_parent == & rd_nil_cfg ) ||
10171020 (row -> block -> parent == & ev_nil_block && evalled_cfg != & rd_nil_cfg ))
10181021 {
10191022 RD_Cfg * cfg = evalled_cfg ;
@@ -1052,16 +1055,18 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row)
10521055 }
10531056
10541057 // rjf: entity rows
1055- else if (info .eval .space .kind == RD_EvalSpaceKind_MetaCtrlEntity && info .group_entity != & ctrl_entity_nil )
1058+ else if ((info .eval .space .kind == RD_EvalSpaceKind_MetaCtrlEntity && row_entity_eval_matches_group && info .group_entity != & ctrl_entity_nil ) ||
1059+ (row -> block -> parent == & ev_nil_block && evalled_entity != & ctrl_entity_nil ))
10561060 {
1057- rd_watch_cell_list_push_new (arena , & info .cells , RD_WatchCellKind_Expr , .flags = RD_WatchCellFlag_Button , .pct = 1.f , .fstrs = rd_title_fstrs_from_ctrl_entity (arena , info .group_entity , ui_top_palette ()-> text_weak , ui_top_font_size (), 1 ));
1061+ CTRL_Entity * entity = evalled_entity ;
1062+ rd_watch_cell_list_push_new (arena , & info .cells , RD_WatchCellKind_Expr , .flags = RD_WatchCellFlag_Button , .pct = 1.f , .fstrs = rd_title_fstrs_from_ctrl_entity (arena , entity , ui_top_palette ()-> text_weak , ui_top_font_size (), 1 ));
10581063 }
10591064
10601065 // rjf: singular button for commands
10611066 else if ((block_eval .space .kind == RD_EvalSpaceKind_MetaCmdCollection ||
10621067 block_eval .space .kind == RD_EvalSpaceKind_MetaCfgCollection ) &&
10631068 info .eval .space .kind == RD_EvalSpaceKind_MetaCmd &&
1064- row_eval_matches_group )
1069+ row_cfg_eval_matches_group )
10651070 {
10661071 RD_CmdKind cmd_kind = e_value_eval_from_eval (info .eval ).value .u64 ;
10671072 RD_CmdKindInfo * cmd_kind_info = & rd_cmd_kind_info_table [cmd_kind ];
@@ -2944,6 +2949,17 @@ RD_VIEW_UI_FUNCTION_DEF(watch)
29442949 {
29452950 RD_RegsScope (.cfg = cell_info .cfg -> id ) rd_drag_begin (RD_RegSlot_Cfg );
29462951 }
2952+ else if (cell_info .entity != & ctrl_entity_nil )
2953+ {
2954+ RD_RegsScope (.ctrl_entity = cell_info .entity -> handle ) switch (cell_info .entity -> kind )
2955+ {
2956+ default :{rd_drag_begin (RD_RegSlot_CtrlEntity );}break ;
2957+ case CTRL_EntityKind_Machine :{RD_RegsScope (.machine = cell_info .entity -> handle ) rd_drag_begin (RD_RegSlot_Machine );}break ;
2958+ case CTRL_EntityKind_Process :{RD_RegsScope (.process = cell_info .entity -> handle ) rd_drag_begin (RD_RegSlot_Process );}break ;
2959+ case CTRL_EntityKind_Module :{RD_RegsScope (.module = cell_info .entity -> handle ) rd_drag_begin (RD_RegSlot_Module );}break ;
2960+ case CTRL_EntityKind_Thread :{RD_RegsScope (.thread = cell_info .entity -> handle ) rd_drag_begin (RD_RegSlot_Thread );}break ;
2961+ }
2962+ }
29472963 }
29482964
29492965 // rjf: (normally) single-click -> move selection here
0 commit comments