fix scroll bar size in watch views with changed font size, fix type evaluations

This commit is contained in:
Ryan Fleury
2025-04-18 11:03:40 -07:00
parent 2fd5e743b9
commit ddf0703b02
7 changed files with 29 additions and 17 deletions
+1
View File
@@ -2142,6 +2142,7 @@ e_irtree_and_type_from_expr(Arena *arena, E_Expr *root_expr)
if(!generated && !e_type_key_match(e_type_key_zero(), mapped_type_key))
{
generated = 1;
result.root = e_irtree_const_u(arena, 0);
result.type_key = mapped_type_key;
result.mode = E_Mode_Null;
}
+6 -3
View File
@@ -4,7 +4,7 @@
//- GENERATED CODE
C_LINKAGE_BEGIN
RD_VocabInfo rd_vocab_info_table[319] =
RD_VocabInfo rd_vocab_info_table[321] =
{
{str8_lit_comp("auto_view_rule"), str8_lit_comp("auto_view_rules"), str8_lit_comp("Auto View Rule"), str8_lit_comp("Auto View Rules"), RD_IconKind_Binoculars},
{str8_lit_comp("file_path_map"), str8_lit_comp("file_path_maps"), str8_lit_comp("File Path Map"), str8_lit_comp("File Path Maps"), RD_IconKind_FileOutline},
@@ -112,6 +112,8 @@ RD_VocabInfo rd_vocab_info_table[319] =
{str8_lit_comp("smooth_code_text"), str8_lit_comp(""), str8_lit_comp("Smooth Code Text"), str8_lit_comp(""), RD_IconKind_Null},
{str8_lit_comp("hint_ui_text"), str8_lit_comp(""), str8_lit_comp("Hint UI Text"), str8_lit_comp(""), RD_IconKind_Null},
{str8_lit_comp("hint_code_text"), str8_lit_comp(""), str8_lit_comp("Hint Code Text"), str8_lit_comp(""), RD_IconKind_Null},
{str8_lit_comp("opaque_backgrounds"), str8_lit_comp(""), str8_lit_comp("Opaque Backgrounds"), str8_lit_comp(""), RD_IconKind_Null},
{str8_lit_comp("background_blur"), str8_lit_comp(""), str8_lit_comp("Background Blur"), str8_lit_comp(""), RD_IconKind_Null},
{str8_lit_comp("launch_and_run"), str8_lit_comp(""), str8_lit_comp("Launch and Run"), str8_lit_comp(""), RD_IconKind_Play},
{str8_lit_comp("launch_and_step_into"), str8_lit_comp(""), str8_lit_comp("Launch and Step Into"), str8_lit_comp(""), RD_IconKind_PlayStepForward},
{str8_lit_comp("kill"), str8_lit_comp(""), str8_lit_comp("Kill"), str8_lit_comp(""), RD_IconKind_X},
@@ -327,11 +329,12 @@ RD_VocabInfo rd_vocab_info_table[319] =
{str8_lit_comp("log_marker"), str8_lit_comp(""), str8_lit_comp("Log Marker"), str8_lit_comp(""), RD_IconKind_Null},
};
RD_NameSchemaInfo rd_name_schema_info_table[19] =
RD_NameSchemaInfo rd_name_schema_info_table[20] =
{
{str8_lit_comp("settings"), str8_lit_comp("x:\n{\n @default(1) 'hover_animations': bool,\n @default(1) 'press_animations': bool,\n @default(0) 'focus_animations': bool,\n @default(1) 'tooltip_animations': bool,\n @default(1) 'menu_animations': bool,\n @default(1) 'scrolling_animations': bool,\n @default(1) 'background_blur': bool,\n @default(1) 'thread_lines': bool,\n @default(1) 'breakpoint_lines': bool,\n @default(1) 'thread_glow': bool,\n @default(1) 'breakpoint_glow': bool,\n @default(0) 'opaque_backgrounds': bool,\n @default(1) 'smooth_ui_text': bool,\n @default(0) 'smooth_code_text': bool,\n @default(1) 'hint_ui_text': bool,\n @default(1) 'hint_code_text': bool,\n @default(2) 'tab_width': @range[1, 32] u64,\n @default(11) 'font_size': @range[6, 72] u64,\n}\n")},
{str8_lit_comp("window"), str8_lit_comp("x:\n{\n //- rjf: animations\n @default(1) 'hover_animations': bool,\n @default(1) 'press_animations': bool,\n @default(0) 'focus_animations': bool,\n @default(1) 'tooltip_animations': bool,\n @default(1) 'menu_animations': bool,\n @default(1) 'scrolling_animations': bool,\n\n //- rjf: thread & breakpoint decorations\n @default(1) 'thread_lines': bool,\n @default(1) 'thread_glow': bool,\n @default(1) 'breakpoint_lines': bool,\n @default(1) 'breakpoint_glow': bool,\n\n //- rjf: occluding background settings\n @default(0) 'opaque_backgrounds': bool,\n @default(1) 'background_blur': bool,\n\n //- rjf: text rasterization settings\n @default(1) 'smooth_ui_text': bool,\n @default(1) 'hint_ui_text': bool,\n @default(0) 'smooth_code_text': bool,\n @default(1) 'hint_code_text': bool,\n @default(11) 'font_size': @range[6, 72] u64,\n}\n")},
{str8_lit_comp("tab"), str8_lit_comp("x:\n{\n @default(11) 'font_size': @range[6, 72] u64,\n}\n")},
{str8_lit_comp("watch"), str8_lit_comp("@inherit(tab) x:\n{}\n")},
{str8_lit_comp("text"), str8_lit_comp("@inherit(tab) x:\n{\n 'lang':lang,\n 'size':code_string,\n @default(1) 'show_line_numbers':bool,\n}\n")},
{str8_lit_comp("disasm"), str8_lit_comp("@inherit(tab) x:\n{\n 'arch': arch,\n 'syntax': dasm_syntax,\n 'size': code_string,\n @default(1) 'show_addresses': bool,\n @default(0) 'show_code_bytes': bool,\n @default(1) 'show_source_lines': bool,\n @default(1) 'show_symbol_names': bool,\n @default(1) 'show_line_numbers': bool,\n}\n")},
{str8_lit_comp("memory"), str8_lit_comp("@inherit(tab) x:\n{\n 'size': code_string,\n @default(16) 'num_columns': @range[1, 64] u64,\n @default(1) 'bytes_per_cell': @range[1, 8] u64,\n}\n")},
@@ -339,7 +342,7 @@ RD_NameSchemaInfo rd_name_schema_info_table[19] =
{str8_lit_comp("geo3d"), str8_lit_comp("@inherit(tab) x:\n{\n 'count': code_string,\n 'vtx': code_string,\n 'vtx_size': code_string,\n 'yaw': @range[0, 1] f32,\n 'pitch': @range[-0.5, 0] f32,\n 'zoom': @range[0, 100] f32,\n}\n")},
{str8_lit_comp("target"), str8_lit_comp("@row_commands(enable_cfg, launch_and_run, launch_and_step_into, remove_cfg)\n@collection_commands(add_target)\nx:\n{\n 'label': code_string,\n 'executable': path,\n 'arguments': string,\n 'working_directory': path,\n 'entry_point': code_string,\n 'stdout_path': path,\n 'stderr_path': path,\n 'stdin_path': path,\n 'environment': query,\n 'debug_subprocesses': bool,\n @no_expand @default(0) 'enabled': bool,\n}\n")},
{str8_lit_comp("breakpoint"), str8_lit_comp("@row_commands(enable_cfg, remove_cfg)\n@collection_commands(toggle_breakpoint, add_breakpoint, add_address_breakpoint)\nx:\n{\n 'label': code_string,\n 'condition': code_string,\n 'source_location': path_pt,\n 'address_location': code_string,\n 'hit_count': u64,\n 'address_range_size': @or(0, 1, 2, 4, 8) u64,\n 'break_on_write': bool,\n 'break_on_read': bool,\n 'break_on_execute': bool,\n @no_expand @default(1) 'enabled': bool,\n}\n")},
{str8_lit_comp("watch_pin"), str8_lit_comp("@row_commands(remove_cfg)\n@collection_commands(add_watch_pin)\nx:\n{\n 'expression': code_string,\n 'view_rule': code_string,\n 'source_location': path_pt,\n 'address_location': code_string,\n}\n")},
{str8_lit_comp("watch_pin"), str8_lit_comp("@row_commands(remove_cfg)\n@collection_commands(add_watch_pin)\nx:\n{\n 'expression': code_string,\n 'source_location': path_pt,\n 'address_location': code_string,\n}\n")},
{str8_lit_comp("file_path_map"), str8_lit_comp("@collection_commands(add_file_path_map) @row_commands(remove_cfg) x:{'source':path, 'dest':path}")},
{str8_lit_comp("auto_view_rule"), str8_lit_comp("@collection_commands(add_auto_view_rule) @row_commands(remove_cfg) x:{'type':code_string, 'view_rule':code_string}")},
{str8_lit_comp("recent_project"), str8_lit_comp("x:{'path':path}")},
+2 -2
View File
@@ -637,8 +637,8 @@ RD_Query query;
.os_event = rd_regs()->os_event,\
C_LINKAGE_BEGIN
extern RD_VocabInfo rd_vocab_info_table[319];
extern RD_NameSchemaInfo rd_name_schema_info_table[19];
extern RD_VocabInfo rd_vocab_info_table[321];
extern RD_NameSchemaInfo rd_name_schema_info_table[20];
extern Rng1U64 rd_reg_slot_range_table[40];
extern String8 rd_binding_version_remap_old_name_table[8];
extern String8 rd_binding_version_remap_new_name_table[8];
+9 -1
View File
@@ -125,6 +125,8 @@ RD_VocabTable:
{smooth_code_text "" "Smooth Code Text" "" Null }
{hint_ui_text "" "Hint UI Text" "" Null }
{hint_code_text "" "Hint Code Text" "" Null }
{opaque_backgrounds "" "Opaque Backgrounds" "" Null }
{background_blur "" "Background Blur" "" Null }
}
@struct RD_VocabInfo:
@@ -221,6 +223,13 @@ RD_VocabTable:
}
//- rjf: views
{
watch,
```
@inherit(tab) x:
{}
```
}
{
text,
```
@@ -339,7 +348,6 @@ RD_VocabTable:
x:
{
'expression': code_string,
'view_rule': code_string,
'source_location': path_pt,
'address_location': code_string,
}
+7 -7
View File
@@ -3617,7 +3617,7 @@ rd_view_ui(Rng2F32 rect)
ProfScope("build ui")
{
Vec2F32 rect_dim = dim_2f32(rect);
F32 contents_width_px = (rect_dim.x - floor_f32(ui_top_font_size()*1.5f));
F32 contents_width_px = (rect_dim.x - floor_f32(ui_bottom_font_size()*1.5f));
Rng1S64 visible_row_rng = {0};
UI_ScrollListParams scroll_list_params = {0};
{
@@ -4426,12 +4426,12 @@ rd_view_ui(Rng2F32 rect)
case CTRL_EntityKind_Thread:{RD_RegsScope(.thread = cell_info.entity->handle) rd_drag_begin(RD_RegSlot_Thread);}break;
}
}
else if(row->eval.space.kind == RD_EvalSpaceKind_CtrlEntity ||
row->eval.space.kind == E_SpaceKind_FileSystem ||
row->eval.space.kind == E_SpaceKind_File ||
row->eval.space.kind == E_SpaceKind_Null)
else if(cell_info.eval.space.kind == RD_EvalSpaceKind_CtrlEntity ||
cell_info.eval.space.kind == E_SpaceKind_FileSystem ||
cell_info.eval.space.kind == E_SpaceKind_File ||
cell_info.eval.space.kind == E_SpaceKind_Null)
{
RD_RegsScope(.expr = e_string_from_expr(scratch.arena, row->eval.expr))
RD_RegsScope(.expr = e_string_from_expr(scratch.arena, cell_info.eval.expr))
rd_drag_begin(RD_RegSlot_Expr);
}
}
@@ -6548,7 +6548,7 @@ rd_window_frame(void)
E_Eval query_eval = e_eval_from_string(scratch.arena, query_expr);
// rjf: compute query view's top-level rectangle
F32 row_height_px = ui_top_px_height();
F32 row_height_px = floor_f32(ui_top_px_height());
Rng2F32 rect = {0};
RD_RegsScope(.view = view->id)
{
+3 -3
View File
@@ -3136,7 +3136,7 @@ rd_cell(RD_CellParams *params, String8 string)
//////////////////////////////
//- rjf: unpack visual metrics
//
F32 expander_size_px = ui_top_font_size()*2.f;
F32 expander_size_px = floor_f32(ui_top_font_size()*2.f);
//////////////////////////////
//- rjf: make key
@@ -3281,8 +3281,8 @@ rd_cell(RD_CellParams *params, String8 string)
if(params->flags & RD_CellFlag_Slider && !is_focus_active)
UI_Parent(box)
{
F32 padding_px = floor_f32(ui_top_font_size()*0.65f);
F32 height_px = ui_top_px_height() - padding_px*2.f;
F32 height_px = ui_top_font_size() * 1.75f;
F32 padding_px = (ui_top_px_height() - height_px) / 2.f;
UI_PrefWidth(ui_children_sum(1.f))
UI_HeightFill
UI_Column UI_Padding(ui_px(padding_px, 1.f))
+1 -1
View File
@@ -1457,7 +1457,7 @@ ui_scroll_list_begin(UI_ScrollListParams *params, UI_ScrollPt *scroll_pt, Vec2S6
*visible_row_range_out = visible_row_range;
//- rjf: store thread-locals
ui_scroll_list_scroll_bar_dim_px = ui_top_font_size()*1.5f;
ui_scroll_list_scroll_bar_dim_px = ui_bottom_font_size()*1.5f;
ui_scroll_list_scroll_pt_ptr = scroll_pt;
ui_scroll_list_dim_px = params->dim_px;
ui_scroll_list_scroll_idx_rng = scroll_row_idx_range;