mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-22 19:54:59 -07:00
formalize tab size in all ui codepaths, per-box; pick 4*columnsize by default in text views
This commit is contained in:
+21
-21
@@ -5992,7 +5992,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
|
||||
//- rjf: calculate width of exp row
|
||||
if(row == viz_rows.first)
|
||||
{
|
||||
expr_column_width_px = f_dim_from_tag_size_string(ui_top_font(), ui_top_font_size(), 0, UI_TEMP_TAB_WIDTH, row->display_expr).x + ui_top_font_size()*0.5f;
|
||||
expr_column_width_px = f_dim_from_tag_size_string(ui_top_font(), ui_top_font_size(), 0, ui_top_tab_size(), row->display_expr).x + ui_top_font_size()*0.5f;
|
||||
expr_column_width_px = Max(expr_column_width_px, ui_top_font_size()*10.f);
|
||||
}
|
||||
|
||||
@@ -7153,7 +7153,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
|
||||
d_fancy_string_list_push(scratch.arena, &fstrs, &query);
|
||||
}
|
||||
UI_Box *box = ui_build_box_from_key(UI_BoxFlag_DrawText, ui_key_zero());
|
||||
ui_box_equip_display_fancy_strings(box, &fstrs);
|
||||
ui_box_equip_display_fancy_strings(box, ui_top_tab_size(), &fstrs);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
}
|
||||
@@ -7771,7 +7771,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
|
||||
if(!(box->flags & UI_BoxFlag_DisableTextTrunc))
|
||||
{
|
||||
max_x = (box->rect.x1-text_position.x);
|
||||
ellipses_run = f_push_run_from_string(scratch.arena, box->font, box->font_size, 0, UI_TEMP_TAB_WIDTH, 0, str8_lit("..."));
|
||||
ellipses_run = f_push_run_from_string(scratch.arena, box->font, box->font_size, 0, box->tab_size, 0, str8_lit("..."));
|
||||
}
|
||||
d_truncated_fancy_run_list(text_position, &box->display_string_runs, max_x, ellipses_run);
|
||||
if(box->flags & UI_BoxFlag_HasFuzzyMatchRanges)
|
||||
@@ -8040,8 +8040,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
|
||||
d_fancy_string_list_push(scratch.arena, &strs, &str2);
|
||||
D_FancyString str3 = {df_font_from_slot(DF_FontSlot_Code), str8_lit("very fancy text!"), v4f32(1, 0.8f, 0.4f, 1), 18.f, 4.f, 4.f};
|
||||
d_fancy_string_list_push(scratch.arena, &strs, &str3);
|
||||
D_FancyRunList runs = d_fancy_run_list_from_fancy_string_list(scratch.arena, UI_TEMP_TAB_WIDTH, &strs);
|
||||
F_Run trailer_run = f_push_run_from_string(scratch.arena, df_font_from_slot(DF_FontSlot_Main), 16.f, 0, UI_TEMP_TAB_WIDTH, 0, str8_lit("..."));
|
||||
D_FancyRunList runs = d_fancy_run_list_from_fancy_string_list(scratch.arena, 0, &strs);
|
||||
F_Run trailer_run = f_push_run_from_string(scratch.arena, df_font_from_slot(DF_FontSlot_Main), 16.f, 0, 0, 0, str8_lit("..."));
|
||||
F32 limit = 500.f + sin_f32(df_time_in_seconds()/10.f)*200.f;
|
||||
d_truncated_fancy_run_list(p, &runs, limit, trailer_run);
|
||||
d_rect(r2f32p(p.x+limit, 0, p.x+limit+2.f, 1000), v4f32(1, 0, 0, 1), 0, 0, 0);
|
||||
@@ -11030,7 +11030,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_
|
||||
line_num += 1, line_idx += 1)
|
||||
{
|
||||
String8 line_text = params->line_text[line_idx];
|
||||
F32 line_text_dim = f_dim_from_tag_size_string(params->font, params->font_size, 0, UI_TEMP_TAB_WIDTH, line_text).x + params->line_num_width_px;
|
||||
F32 line_text_dim = f_dim_from_tag_size_string(params->font, params->font_size, 0, params->tab_size, line_text).x + params->line_num_width_px;
|
||||
line_extras_off[line_idx] = Max(line_text_dim, params->font_size*50);
|
||||
}
|
||||
}
|
||||
@@ -11184,7 +11184,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_
|
||||
String8 line_string = (params->line_num_range.min <= line_num && line_num <= params->line_num_range.max) ? (params->line_text[mouse_y_line_idx]) : str8_zero();
|
||||
|
||||
// rjf: mouse x * string => column
|
||||
S64 column = f_char_pos_from_tag_size_string_p(params->font, params->font_size, 0, UI_TEMP_TAB_WIDTH, line_string, mouse.x-text_container_box->rect.x0-params->line_num_width_px)+1;
|
||||
S64 column = f_char_pos_from_tag_size_string_p(params->font, params->font_size, 0, params->tab_size, line_string, mouse.x-text_container_box->rect.x0-params->line_num_width_px)+1;
|
||||
|
||||
// rjf: bundle
|
||||
mouse_pt = txt_pt(line_num, column);
|
||||
@@ -11361,7 +11361,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_
|
||||
{
|
||||
U64 line_slice_idx = mouse_pt.line-params->line_num_range.min;
|
||||
String8 line_text = params->line_text[line_slice_idx];
|
||||
F32 expr_hoff_px = params->line_num_width_px + f_dim_from_tag_size_string(params->font, params->font_size, UI_TEMP_BASE_COLUMN_TODO, UI_TEMP_TAB_WIDTH, str8_prefix(line_text, selected_rng.min.column-1)).x;
|
||||
F32 expr_hoff_px = params->line_num_width_px + f_dim_from_tag_size_string(params->font, params->font_size, 0, params->tab_size, str8_prefix(line_text, selected_rng.min.column-1)).x;
|
||||
result.mouse_expr_rng = selected_rng;
|
||||
result.mouse_expr_baseline_pos = v2f32(text_container_box->rect.x0+expr_hoff_px,
|
||||
text_container_box->rect.y0+line_slice_idx*params->line_height_px + params->line_height_px*0.85f);
|
||||
@@ -11376,7 +11376,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_
|
||||
Rng1U64 expr_off_rng = txti_expr_range_from_line_off_range_string_tokens(mouse_pt_off, line_range, line_text, &line_tokens);
|
||||
if(expr_off_rng.max != expr_off_rng.min)
|
||||
{
|
||||
F32 expr_hoff_px = params->line_num_width_px + f_dim_from_tag_size_string(params->font, params->font_size, UI_TEMP_BASE_COLUMN_TODO, UI_TEMP_TAB_WIDTH, str8_prefix(line_text, expr_off_rng.min-line_range.min)).x;
|
||||
F32 expr_hoff_px = params->line_num_width_px + f_dim_from_tag_size_string(params->font, params->font_size, 0, params->tab_size, str8_prefix(line_text, expr_off_rng.min-line_range.min)).x;
|
||||
result.mouse_expr_rng = txt_rng(txt_pt(mouse_pt.line, 1+(expr_off_rng.min-line_range.min)), txt_pt(mouse_pt.line, 1+(expr_off_rng.max-line_range.min)));
|
||||
result.mouse_expr_baseline_pos = v2f32(text_container_box->rect.x0+expr_hoff_px,
|
||||
text_container_box->rect.y0+line_slice_idx*params->line_height_px + params->line_height_px*0.85f);
|
||||
@@ -11718,7 +11718,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_
|
||||
}
|
||||
|
||||
// rjf: equip fancy strings to line box
|
||||
ui_box_equip_display_fancy_strings(line_box, &line_fancy_strings);
|
||||
ui_box_equip_display_fancy_strings(line_box, params->tab_size, &line_fancy_strings);
|
||||
|
||||
// rjf: extra rendering for strings that are currently being searched for
|
||||
if(params->search_query.size != 0)
|
||||
@@ -11731,8 +11731,8 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_
|
||||
Rng1U64 match_range = r1u64(needle_pos, needle_pos+params->search_query.size);
|
||||
Rng1F32 match_column_pixel_off_range =
|
||||
{
|
||||
f_dim_from_tag_size_string(line_box->font, line_box->font_size, UI_TEMP_BASE_COLUMN_TODO, UI_TEMP_TAB_WIDTH, str8_prefix(line_string, match_range.min)).x,
|
||||
f_dim_from_tag_size_string(line_box->font, line_box->font_size, UI_TEMP_BASE_COLUMN_TODO, UI_TEMP_TAB_WIDTH, str8_prefix(line_string, match_range.max)).x,
|
||||
f_dim_from_tag_size_string(line_box->font, line_box->font_size, 0, params->tab_size, str8_prefix(line_string, match_range.min)).x,
|
||||
f_dim_from_tag_size_string(line_box->font, line_box->font_size, 0, params->tab_size, str8_prefix(line_string, match_range.max)).x,
|
||||
};
|
||||
Rng2F32 match_rect =
|
||||
{
|
||||
@@ -11787,8 +11787,8 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_
|
||||
};
|
||||
Rng1F32 select_column_pixel_off_range =
|
||||
{
|
||||
f_dim_from_tag_size_string(line_box->font, line_box->font_size, UI_TEMP_BASE_COLUMN_TODO, UI_TEMP_TAB_WIDTH, str8_prefix(line_string, select_column_range_in_line.min-1)).x,
|
||||
f_dim_from_tag_size_string(line_box->font, line_box->font_size, UI_TEMP_BASE_COLUMN_TODO, UI_TEMP_TAB_WIDTH, str8_prefix(line_string, select_column_range_in_line.max-1)).x,
|
||||
f_dim_from_tag_size_string(line_box->font, line_box->font_size, 0, params->tab_size, str8_prefix(line_string, select_column_range_in_line.min-1)).x,
|
||||
f_dim_from_tag_size_string(line_box->font, line_box->font_size, 0, params->tab_size, str8_prefix(line_string, select_column_range_in_line.max-1)).x,
|
||||
};
|
||||
Rng2F32 select_rect =
|
||||
{
|
||||
@@ -11816,7 +11816,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_
|
||||
if(cursor->line == line_num)
|
||||
{
|
||||
S64 column = cursor->column;
|
||||
Vec2F32 advance = f_dim_from_tag_size_string(line_box->font, line_box->font_size, UI_TEMP_BASE_COLUMN_TODO, UI_TEMP_TAB_WIDTH, str8_prefix(line_string, column-1));
|
||||
Vec2F32 advance = f_dim_from_tag_size_string(line_box->font, line_box->font_size, 0, params->tab_size, str8_prefix(line_string, column-1));
|
||||
F32 cursor_off_pixels = advance.x;
|
||||
F32 cursor_thickness = ClampBot(4.f, line_box->font_size/6.f);
|
||||
Rng2F32 cursor_rect =
|
||||
@@ -12472,7 +12472,7 @@ df_code_label(F32 alpha, B32 indirection_size_change, Vec4F32 base_color, String
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
D_FancyStringList fancy_strings = df_fancy_string_list_from_code_string(scratch.arena, alpha, indirection_size_change, base_color, string);
|
||||
UI_Box *box = ui_build_box_from_key(UI_BoxFlag_DrawText, ui_key_zero());
|
||||
ui_box_equip_display_fancy_strings(box, &fancy_strings);
|
||||
ui_box_equip_display_fancy_strings(box, ui_top_tab_size(), &fancy_strings);
|
||||
scratch_end(scratch);
|
||||
return box;
|
||||
}
|
||||
@@ -12758,7 +12758,7 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx
|
||||
{
|
||||
String8 edit_string = str8(edit_buffer, edit_string_size_out[0]);
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
F32 total_text_width = f_dim_from_tag_size_string(ui_top_font(), ui_top_font_size(), 0, UI_TEMP_TAB_WIDTH, edit_string).x;
|
||||
F32 total_text_width = f_dim_from_tag_size_string(ui_top_font(), ui_top_font_size(), 0, ui_top_tab_size(), edit_string).x;
|
||||
F32 total_editstr_width = total_text_width - !!(flags & (DF_LineEditFlag_Expander|DF_LineEditFlag_ExpanderSpace|DF_LineEditFlag_ExpanderPlaceholder)) * expander_size_px;
|
||||
ui_set_next_pref_width(ui_px(total_editstr_width+ui_top_font_size()*2, 0.f));
|
||||
UI_Box *editstr_box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_DisableTextTrunc, "###editstr");
|
||||
@@ -12827,7 +12827,7 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx
|
||||
}
|
||||
}
|
||||
}
|
||||
ui_box_equip_display_fancy_strings(editstr_box, &code_fancy_strings);
|
||||
ui_box_equip_display_fancy_strings(editstr_box, ui_top_tab_size(), &code_fancy_strings);
|
||||
UI_LineEditDrawData *draw_data = push_array(ui_build_arena(), UI_LineEditDrawData, 1);
|
||||
draw_data->edited_string = push_str8_copy(ui_build_arena(), edit_string);
|
||||
draw_data->cursor = *cursor;
|
||||
@@ -12836,13 +12836,13 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx
|
||||
draw_data->select_color = ui_top_text_select_color();
|
||||
ui_box_equip_custom_draw(editstr_box, ui_line_edit_draw, draw_data);
|
||||
mouse_pt = txt_pt(1, 1+ui_box_char_pos_from_xy(editstr_box, ui_mouse()));
|
||||
cursor_off = f_dim_from_tag_size_string(ui_top_font(), ui_top_font_size(), UI_TEMP_BASE_COLUMN_TODO, UI_TEMP_TAB_WIDTH, str8_prefix(edit_string, cursor->column-1)).x;
|
||||
cursor_off = f_dim_from_tag_size_string(ui_top_font(), ui_top_font_size(), 0, ui_top_tab_size(), str8_prefix(edit_string, cursor->column-1)).x;
|
||||
scratch_end(scratch);
|
||||
}
|
||||
else if((is_focus_active || is_focus_active_disabled) && !(flags & DF_LineEditFlag_CodeContents))
|
||||
{
|
||||
String8 edit_string = str8(edit_buffer, edit_string_size_out[0]);
|
||||
F32 total_text_width = f_dim_from_tag_size_string(ui_top_font(), ui_top_font_size(), 0, UI_TEMP_TAB_WIDTH, edit_string).x;
|
||||
F32 total_text_width = f_dim_from_tag_size_string(ui_top_font(), ui_top_font_size(), 0, ui_top_tab_size(), edit_string).x;
|
||||
F32 total_editstr_width = total_text_width - !!(flags & (DF_LineEditFlag_Expander|DF_LineEditFlag_ExpanderSpace|DF_LineEditFlag_ExpanderPlaceholder)) * expander_size_px;
|
||||
ui_set_next_pref_width(ui_px(total_editstr_width+ui_top_font_size()*2, 0.f));
|
||||
UI_Box *editstr_box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_DisableTextTrunc, "###editstr");
|
||||
@@ -12855,7 +12855,7 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx
|
||||
ui_box_equip_display_string(editstr_box, edit_string);
|
||||
ui_box_equip_custom_draw(editstr_box, ui_line_edit_draw, draw_data);
|
||||
mouse_pt = txt_pt(1, 1+ui_box_char_pos_from_xy(editstr_box, ui_mouse()));
|
||||
cursor_off = f_dim_from_tag_size_string(ui_top_font(), ui_top_font_size(), UI_TEMP_BASE_COLUMN_TODO, UI_TEMP_TAB_WIDTH, str8_prefix(edit_string, cursor->column-1)).x;
|
||||
cursor_off = f_dim_from_tag_size_string(ui_top_font(), ui_top_font_size(), 0, ui_top_tab_size(), str8_prefix(edit_string, cursor->column-1)).x;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -412,6 +412,7 @@ struct DF_CodeSliceParams
|
||||
// rjf: visual parameters
|
||||
F_Tag font;
|
||||
F32 font_size;
|
||||
F32 tab_size;
|
||||
String8 search_query;
|
||||
F32 line_height_px;
|
||||
F32 margin_width_px;
|
||||
|
||||
@@ -357,7 +357,7 @@ DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(rgba)
|
||||
d_fancy_string_list_push(scratch.arena, &fancy_strings, &a_fstr);
|
||||
d_fancy_string_list_push(scratch.arena, &fancy_strings, &clse_paren);
|
||||
}
|
||||
ui_box_equip_display_fancy_strings(text_box, &fancy_strings);
|
||||
ui_box_equip_display_fancy_strings(text_box, 0, &fancy_strings);
|
||||
}
|
||||
|
||||
//- rjf: build color box
|
||||
@@ -568,6 +568,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(text)
|
||||
}
|
||||
code_slice_params.font = df_font_from_slot(DF_FontSlot_Code);
|
||||
code_slice_params.font_size = ui_top_font_size();
|
||||
code_slice_params.tab_size = f_column_size_from_tag_size(code_slice_params.font, code_slice_params.font_size)*4.f;
|
||||
code_slice_params.line_height_px = ui_top_font_size()*1.5f;
|
||||
code_slice_params.margin_width_px = 0;
|
||||
code_slice_params.line_num_width_px = ui_top_font_size()*5.f;
|
||||
@@ -728,6 +729,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(disasm)
|
||||
}
|
||||
code_slice_params.font = df_font_from_slot(DF_FontSlot_Code);
|
||||
code_slice_params.font_size = ui_top_font_size();
|
||||
code_slice_params.tab_size = f_column_size_from_tag_size(code_slice_params.font, code_slice_params.font_size)*4.f;
|
||||
code_slice_params.line_height_px = ui_top_font_size()*1.5f;
|
||||
code_slice_params.margin_width_px = 0;
|
||||
code_slice_params.line_num_width_px = ui_top_font_size()*5.f;
|
||||
|
||||
+11
-5
@@ -5744,6 +5744,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code)
|
||||
DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view);
|
||||
F_Tag code_font = df_font_from_slot(DF_FontSlot_Code);
|
||||
F32 code_font_size = df_font_size_from_slot(ws, DF_FontSlot_Code);
|
||||
F32 code_tab_size = f_column_size_from_tag_size(code_font, code_font_size)*4.f;
|
||||
F_Metrics code_font_metrics = f_metrics_from_tag_size(code_font, code_font_size);
|
||||
F32 code_line_height = ceil_f32(f_line_height_from_metrics(&code_font_metrics) * 1.5f);
|
||||
F32 big_glyph_advance = f_dim_from_tag_size_string(code_font, code_font_size, 0, 0, str8_lit("H")).x;
|
||||
@@ -5858,6 +5859,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code)
|
||||
code_slice_params.line_src2dasm = push_array(scratch.arena, DF_TextLineSrc2DasmInfoList, visible_line_count);
|
||||
code_slice_params.font = code_font;
|
||||
code_slice_params.font_size = code_font_size;
|
||||
code_slice_params.tab_size = code_tab_size;
|
||||
code_slice_params.line_height_px = code_line_height;
|
||||
code_slice_params.search_query = search_query;
|
||||
code_slice_params.margin_width_px = margin_width_px;
|
||||
@@ -6357,7 +6359,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code)
|
||||
{
|
||||
tv->center_cursor = 0;
|
||||
String8 cursor_line = str8_substr(data, text_info.lines_ranges[tv->cursor.line-1]);
|
||||
F32 cursor_advance = f_dim_from_tag_size_string(code_font, code_font_size, UI_TEMP_BASE_COLUMN_TODO, UI_TEMP_TAB_WIDTH, str8_prefix(cursor_line, tv->cursor.column-1)).x;
|
||||
F32 cursor_advance = f_dim_from_tag_size_string(code_font, code_font_size, 0, code_tab_size, str8_prefix(cursor_line, tv->cursor.column-1)).x;
|
||||
|
||||
// rjf: scroll x
|
||||
{
|
||||
@@ -6380,7 +6382,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code)
|
||||
if(snap[Axis2_X])
|
||||
{
|
||||
String8 cursor_line = str8_substr(data, text_info.lines_ranges[tv->cursor.line-1]);
|
||||
S64 cursor_off = (S64)(f_dim_from_tag_size_string(code_font, code_font_size, UI_TEMP_BASE_COLUMN_TODO, UI_TEMP_TAB_WIDTH, str8_prefix(cursor_line, tv->cursor.column-1)).x + margin_width_px + line_num_width_px);
|
||||
S64 cursor_off = (S64)(f_dim_from_tag_size_string(code_font, code_font_size, 0, code_tab_size, str8_prefix(cursor_line, tv->cursor.column-1)).x + margin_width_px + line_num_width_px);
|
||||
Rng1S64 visible_pixel_range =
|
||||
{
|
||||
view->scroll_pos.x.idx,
|
||||
@@ -6808,6 +6810,7 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly)
|
||||
DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view);
|
||||
F_Tag code_font = df_font_from_slot(DF_FontSlot_Code);
|
||||
F32 code_font_size = df_font_size_from_slot(ws, DF_FontSlot_Code);
|
||||
F32 code_tab_size = f_column_size_from_tag_size(code_font, code_font_size)*4.f;
|
||||
F_Metrics code_font_metrics = f_metrics_from_tag_size(code_font, code_font_size);
|
||||
F32 code_line_height = ceil_f32(f_line_height_from_metrics(&code_font_metrics) * 1.5f);
|
||||
F32 big_glyph_advance = f_dim_from_tag_size_string(code_font, code_font_size, 0, 0, str8_lit("H")).x;
|
||||
@@ -6945,6 +6948,7 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly)
|
||||
code_slice_params.line_src2dasm = push_array(scratch.arena, DF_TextLineSrc2DasmInfoList, visible_line_count);
|
||||
code_slice_params.font = code_font;
|
||||
code_slice_params.font_size = code_font_size;
|
||||
code_slice_params.tab_size = code_tab_size;
|
||||
code_slice_params.line_height_px = code_line_height;
|
||||
code_slice_params.search_query = search_query;
|
||||
code_slice_params.margin_width_px = margin_width_px;
|
||||
@@ -7675,6 +7679,7 @@ DF_VIEW_UI_FUNCTION_DEF(Output)
|
||||
DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view);
|
||||
F_Tag code_font = df_font_from_slot(DF_FontSlot_Code);
|
||||
F32 code_font_size = df_font_size_from_slot(ws, DF_FontSlot_Code);
|
||||
F32 code_tab_size = f_column_size_from_tag_size(code_font, code_font_size)*4.f;
|
||||
F_Metrics code_font_metrics = f_metrics_from_tag_size(code_font, code_font_size);
|
||||
F32 code_line_height = ceil_f32(f_line_height_from_metrics(&code_font_metrics) * 1.5f);
|
||||
F32 big_glyph_advance = f_dim_from_tag_size_string(code_font, code_font_size, 0, 0, str8_lit("H")).x;
|
||||
@@ -7785,6 +7790,7 @@ DF_VIEW_UI_FUNCTION_DEF(Output)
|
||||
code_slice_params.line_src2dasm = push_array(scratch.arena, DF_TextLineSrc2DasmInfoList, slice.line_count);
|
||||
code_slice_params.font = code_font;
|
||||
code_slice_params.font_size = code_font_size;
|
||||
code_slice_params.tab_size = code_tab_size;
|
||||
code_slice_params.line_height_px = code_line_height;
|
||||
code_slice_params.search_query = search_query;
|
||||
code_slice_params.margin_width_px = margin_width_px;
|
||||
@@ -8050,7 +8056,7 @@ DF_VIEW_UI_FUNCTION_DEF(Output)
|
||||
{
|
||||
tv->center_cursor = 0;
|
||||
String8 cursor_line = txti_string_from_handle_line_num(scratch.arena, txti_handle, tv->cursor.line);
|
||||
F32 cursor_advance = f_dim_from_tag_size_string(code_font, code_font_size, UI_TEMP_BASE_COLUMN_TODO, UI_TEMP_TAB_WIDTH, str8_prefix(cursor_line, tv->cursor.column-1)).x;
|
||||
F32 cursor_advance = f_dim_from_tag_size_string(code_font, code_font_size, 0, code_tab_size, str8_prefix(cursor_line, tv->cursor.column-1)).x;
|
||||
|
||||
// rjf: scroll x
|
||||
{
|
||||
@@ -8073,7 +8079,7 @@ DF_VIEW_UI_FUNCTION_DEF(Output)
|
||||
if(snap[Axis2_X])
|
||||
{
|
||||
String8 cursor_line = txti_string_from_handle_line_num(scratch.arena, txti_handle, tv->cursor.line);
|
||||
S64 cursor_off = (S64)(f_dim_from_tag_size_string(code_font, code_font_size, UI_TEMP_BASE_COLUMN_TODO, UI_TEMP_TAB_WIDTH, str8_prefix(cursor_line, tv->cursor.column-1)).x + margin_width_px + line_num_width_px);
|
||||
S64 cursor_off = (S64)(f_dim_from_tag_size_string(code_font, code_font_size, 0, code_tab_size, str8_prefix(cursor_line, tv->cursor.column-1)).x + margin_width_px + line_num_width_px);
|
||||
Rng1S64 visible_pixel_range =
|
||||
{
|
||||
view->scroll_pos.x.idx,
|
||||
@@ -8899,7 +8905,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory)
|
||||
ui_set_next_background_color(cell_bg_rgba);
|
||||
}
|
||||
UI_Box *cell_box = ui_build_box_from_key(UI_BoxFlag_DrawText|cell_flags, ui_key_zero());
|
||||
ui_box_equip_display_fancy_strings(cell_box, &byte_fancy_strings[byte_value]);
|
||||
ui_box_equip_display_fancy_strings(cell_box, 0, &byte_fancy_strings[byte_value]);
|
||||
{
|
||||
F32 off = 0;
|
||||
for(Annotation *a = annotation; a != 0; a = a->next)
|
||||
|
||||
+13
-11
@@ -70,14 +70,15 @@ d_string_from_fancy_string_list(Arena *arena, D_FancyStringList *list)
|
||||
}
|
||||
|
||||
internal D_FancyRunList
|
||||
d_fancy_run_list_from_fancy_string_list(Arena *arena, F32 tab_width, D_FancyStringList *strs)
|
||||
d_fancy_run_list_from_fancy_string_list(Arena *arena, F32 tab_size_px, D_FancyStringList *strs)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
D_FancyRunList run_list = {0};
|
||||
F32 base_align_px = 0;
|
||||
for(D_FancyStringNode *n = strs->first; n != 0; n = n->next)
|
||||
{
|
||||
D_FancyRunNode *dst_n = push_array(arena, D_FancyRunNode, 1);
|
||||
dst_n->v.run = f_push_run_from_string(arena, n->v.font, n->v.size, 0, tab_width, 0, n->v.string);
|
||||
dst_n->v.run = f_push_run_from_string(arena, n->v.font, n->v.size, base_align_px, tab_size_px, 0, n->v.string);
|
||||
dst_n->v.color = n->v.color;
|
||||
dst_n->v.underline_thickness = n->v.underline_thickness;
|
||||
dst_n->v.strikethrough_thickness = n->v.strikethrough_thickness;
|
||||
@@ -85,6 +86,7 @@ d_fancy_run_list_from_fancy_string_list(Arena *arena, F32 tab_width, D_FancyStri
|
||||
run_list.node_count += 1;
|
||||
run_list.dim.x += dst_n->v.run.dim.x;
|
||||
run_list.dim.y = Max(run_list.dim.y, dst_n->v.run.dim.y);
|
||||
base_align_px += dst_n->v.run.dim.x;
|
||||
}
|
||||
ProfEnd();
|
||||
return run_list;
|
||||
@@ -703,44 +705,44 @@ d_truncated_text_run(Vec2F32 p, Vec4F32 color, F32 max_x, F_Run text_run, F_Run
|
||||
}
|
||||
|
||||
internal void
|
||||
d_text(F_Tag font, F32 size, F32 base_column, F32 tab_width, Vec2F32 p, Vec4F32 color, String8 string)
|
||||
d_text(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, Vec2F32 p, Vec4F32 color, String8 string)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
F_Run run = f_push_run_from_string(scratch.arena, font, size, base_column, tab_width, 0, string);
|
||||
F_Run run = f_push_run_from_string(scratch.arena, font, size, base_align_px, tab_size_px, 0, string);
|
||||
d_text_run(p, color, run);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
internal void
|
||||
d_textf(F_Tag font, F32 size, F32 base_column, F32 tab_width, Vec2F32 p, Vec4F32 color, char *fmt, ...)
|
||||
d_textf(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, Vec2F32 p, Vec4F32 color, char *fmt, ...)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
String8 string = push_str8fv(scratch.arena, fmt, args);
|
||||
va_end(args);
|
||||
d_text(font, size, base_column, tab_width, p, color, string);
|
||||
d_text(font, size, base_align_px, tab_size_px, p, color, string);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
internal void
|
||||
d_truncated_text(F_Tag font, F32 size, F32 base_column, F32 tab_width, Vec2F32 p, Vec4F32 color, F32 max_x, String8 string)
|
||||
d_truncated_text(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, Vec2F32 p, Vec4F32 color, F32 max_x, String8 string)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
F_Run run = f_push_run_from_string(scratch.arena, font, size, base_column, tab_width, 0, string);
|
||||
F_Run ellipses_run = f_push_run_from_string(scratch.arena, font, size, base_column, tab_width, 0, str8_lit("..."));
|
||||
F_Run run = f_push_run_from_string(scratch.arena, font, size, base_align_px, tab_size_px, 0, string);
|
||||
F_Run ellipses_run = f_push_run_from_string(scratch.arena, font, size, base_align_px, tab_size_px, 0, str8_lit("..."));
|
||||
d_truncated_text_run(p, color, max_x, run, ellipses_run);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
internal void
|
||||
d_truncated_textf(F_Tag font, F32 size, F32 base_column, F32 tab_width, Vec2F32 p, Vec4F32 color, F32 max_x, char *fmt, ...)
|
||||
d_truncated_textf(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, Vec2F32 p, Vec4F32 color, F32 max_x, char *fmt, ...)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
String8 string = push_str8f(scratch.arena, fmt, args);
|
||||
d_truncated_text(font, size, base_column, tab_width, p, color, max_x, string);
|
||||
d_truncated_text(font, size, base_align_px, tab_size_px, p, color, max_x, string);
|
||||
va_end(args);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
+5
-5
@@ -110,7 +110,7 @@ internal U64 d_hash_from_string(String8 string);
|
||||
|
||||
internal void d_fancy_string_list_push(Arena *arena, D_FancyStringList *list, D_FancyString *str);
|
||||
internal String8 d_string_from_fancy_string_list(Arena *arena, D_FancyStringList *list);
|
||||
internal D_FancyRunList d_fancy_run_list_from_fancy_string_list(Arena *arena, F32 tab_width, D_FancyStringList *strs);
|
||||
internal D_FancyRunList d_fancy_run_list_from_fancy_string_list(Arena *arena, F32 tab_size_px, D_FancyStringList *strs);
|
||||
internal D_FancyRunList d_fancy_run_list_copy(Arena *arena, D_FancyRunList *src);
|
||||
|
||||
////////////////////////////////
|
||||
@@ -186,9 +186,9 @@ internal void d_truncated_fancy_run_list(Vec2F32 p, D_FancyRunList *list, F32 ma
|
||||
internal void d_truncated_fancy_run_fuzzy_matches(Vec2F32 p, D_FancyRunList *list, F32 max_x, FuzzyMatchRangeList *ranges, Vec4F32 color);
|
||||
internal void d_text_run(Vec2F32 p, Vec4F32 color, F_Run run);
|
||||
internal void d_truncated_text_run(Vec2F32 p, Vec4F32 color, F32 max_x, F_Run text_run, F_Run trailer_run);
|
||||
internal void d_text(F_Tag font, F32 size, F32 base_column, F32 tab_width, Vec2F32 p, Vec4F32 color, String8 string);
|
||||
internal void d_textf(F_Tag font, F32 size, F32 base_column, F32 tab_width, Vec2F32 p, Vec4F32 color, char *fmt, ...);
|
||||
internal void d_truncated_text(F_Tag font, F32 size, F32 base_column, F32 tab_width, Vec2F32 p, Vec4F32 color, F32 max_x, String8 string);
|
||||
internal void d_truncated_textf(F_Tag font, F32 size, F32 base_column, F32 tab_width, Vec2F32 p, Vec4F32 color, F32 max_x, char *fmt, ...);
|
||||
internal void d_text(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, Vec2F32 p, Vec4F32 color, String8 string);
|
||||
internal void d_textf(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, Vec2F32 p, Vec4F32 color, char *fmt, ...);
|
||||
internal void d_truncated_text(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, Vec2F32 p, Vec4F32 color, F32 max_x, String8 string);
|
||||
internal void d_truncated_textf(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, Vec2F32 p, Vec4F32 color, F32 max_x, char *fmt, ...);
|
||||
|
||||
#endif // DRAW_H
|
||||
|
||||
+19
-11
@@ -565,7 +565,7 @@ f_hash2style_from_tag_size(F_Tag tag, F32 size)
|
||||
}
|
||||
|
||||
internal F_Run
|
||||
f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F32 base_column, F32 tab_width, F_RunFlags flags, String8 string)
|
||||
f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F32 base_align_px, F32 tab_size_px, F_RunFlags flags, String8 string)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
|
||||
@@ -792,7 +792,7 @@ f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F32 base_column, F32 t
|
||||
F32 advance = info->advance;
|
||||
if(is_tab)
|
||||
{
|
||||
advance *= tab_width - mod_f32(base_column, tab_width);
|
||||
advance = tab_size_px - mod_f32(base_align_px, tab_size_px);
|
||||
}
|
||||
|
||||
// rjf: push piece
|
||||
@@ -808,6 +808,7 @@ f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F32 base_column, F32 t
|
||||
piece->decode_size = piece_substring.size;
|
||||
piece->offset = v2s16(0, -hash2style_node->ascent - 4);
|
||||
}
|
||||
base_align_px += advance;
|
||||
dim.x += piece->advance;
|
||||
dim.y = Max(dim.y, dim_2s16(piece->subrect).y);
|
||||
}
|
||||
@@ -836,12 +837,12 @@ f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F32 base_column, F32 t
|
||||
}
|
||||
|
||||
internal String8List
|
||||
f_wrapped_string_lines_from_font_size_string_max(Arena *arena, F_Tag font, F32 size, F32 base_column, F32 tab_width, String8 string, F32 max)
|
||||
f_wrapped_string_lines_from_font_size_string_max(Arena *arena, F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, String8 string, F32 max)
|
||||
{
|
||||
String8List list = {0};
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
F_Run run = f_push_run_from_string(scratch.arena, font, size, base_column, tab_width, 0, string);
|
||||
F_Run run = f_push_run_from_string(scratch.arena, font, size, base_align_px, tab_size_px, 0, string);
|
||||
F32 off_px = 0;
|
||||
U64 off_bytes = 0;
|
||||
U64 line_start_off_bytes = 0;
|
||||
@@ -949,12 +950,12 @@ f_wrapped_string_lines_from_font_size_string_max(Arena *arena, F_Tag font, F32 s
|
||||
}
|
||||
|
||||
internal Vec2F32
|
||||
f_dim_from_tag_size_string(F_Tag tag, F32 size, F32 base_column, F32 tab_width, String8 string)
|
||||
f_dim_from_tag_size_string(F_Tag tag, F32 size, F32 base_align_px, F32 tab_size_px, String8 string)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
Vec2F32 result = {0};
|
||||
F_Run run = f_push_run_from_string(scratch.arena, tag, size, base_column, tab_width, 0, string);
|
||||
F_Run run = f_push_run_from_string(scratch.arena, tag, size, base_align_px, tab_size_px, 0, string);
|
||||
result = run.dim;
|
||||
scratch_end(scratch);
|
||||
ProfEnd();
|
||||
@@ -962,13 +963,13 @@ f_dim_from_tag_size_string(F_Tag tag, F32 size, F32 base_column, F32 tab_width,
|
||||
}
|
||||
|
||||
internal Vec2F32
|
||||
f_dim_from_tag_size_string_list(F_Tag tag, F32 size, F32 base_column, F32 tab_width, String8List list)
|
||||
f_dim_from_tag_size_string_list(F_Tag tag, F32 size, F32 base_align_px, F32 tab_size_px, String8List list)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
Vec2F32 sum = {0};
|
||||
for(String8Node *n = list.first; n != 0; n = n->next)
|
||||
{
|
||||
Vec2F32 str_dim = f_dim_from_tag_size_string(tag, size, base_column, tab_width, n->string);
|
||||
Vec2F32 str_dim = f_dim_from_tag_size_string(tag, size, base_align_px, tab_size_px, n->string);
|
||||
sum.x += str_dim.x;
|
||||
sum.y = Max(sum.y, str_dim.y);
|
||||
}
|
||||
@@ -976,8 +977,15 @@ f_dim_from_tag_size_string_list(F_Tag tag, F32 size, F32 base_column, F32 tab_wi
|
||||
return sum;
|
||||
}
|
||||
|
||||
internal F32
|
||||
f_column_size_from_tag_size(F_Tag tag, F32 size)
|
||||
{
|
||||
F32 result = f_dim_from_tag_size_string(tag, size, 0, 0, str8_lit("H")).x;
|
||||
return result;
|
||||
}
|
||||
|
||||
internal U64
|
||||
f_char_pos_from_tag_size_string_p(F_Tag tag, F32 size, F32 base_column, F32 tab_width, String8 string, F32 p)
|
||||
f_char_pos_from_tag_size_string_p(F_Tag tag, F32 size, F32 base_align_px, F32 tab_size_px, String8 string, F32 p)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
@@ -987,7 +995,7 @@ f_char_pos_from_tag_size_string_p(F_Tag tag, F32 size, F32 base_column, F32 tab_
|
||||
F32 x = 0;
|
||||
for(U64 char_idx = 0; char_idx <= string.size; char_idx += 1)
|
||||
{
|
||||
F32 this_char_distance = fabsf(p - x);
|
||||
F32 this_char_distance = abs_f32(p - x);
|
||||
if(this_char_distance < best_distance || best_distance < 0.f)
|
||||
{
|
||||
best_offset = char_idx;
|
||||
@@ -995,7 +1003,7 @@ f_char_pos_from_tag_size_string_p(F_Tag tag, F32 size, F32 base_column, F32 tab_
|
||||
}
|
||||
if(char_idx < string.size)
|
||||
{
|
||||
x += f_dim_from_tag_size_string(tag, size, base_column, tab_width, str8_substr(string, r1u64(char_idx, char_idx+1))).x;
|
||||
x += f_dim_from_tag_size_string(tag, size, base_align_px, tab_size_px, str8_substr(string, r1u64(char_idx, char_idx+1))).x;
|
||||
}
|
||||
}
|
||||
result = best_offset;
|
||||
|
||||
@@ -131,6 +131,7 @@ struct F_Hash2StyleRasterCacheNode
|
||||
U64 style_hash;
|
||||
F32 ascent;
|
||||
F32 descent;
|
||||
F32 column_width;
|
||||
F_RasterCacheInfo *utf8_class1_direct_map;
|
||||
U64 utf8_class1_direct_map_mask[4];
|
||||
U64 hash2info_slots_count;
|
||||
@@ -247,11 +248,12 @@ internal F_PieceArray f_piece_array_copy(Arena *arena, F_PieceArray *src);
|
||||
//~ rjf: Rasterization Cache
|
||||
|
||||
internal F_Hash2StyleRasterCacheNode *f_hash2style_from_tag_size(F_Tag tag, F32 size);
|
||||
internal F_Run f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F32 base_column, F32 tab_width, F_RunFlags flags, String8 string);
|
||||
internal String8List f_wrapped_string_lines_from_font_size_string_max(Arena *arena, F_Tag font, F32 size, F32 base_column, F32 tab_width, String8 string, F32 max);
|
||||
internal Vec2F32 f_dim_from_tag_size_string(F_Tag tag, F32 size, F32 base_column, F32 tab_width, String8 string);
|
||||
internal Vec2F32 f_dim_from_tag_size_string_list(F_Tag tag, F32 size, F32 base_column, F32 tab_width, String8List list);
|
||||
internal U64 f_char_pos_from_tag_size_string_p(F_Tag tag, F32 size, F32 base_column, F32 tab_width, String8 string, F32 p);
|
||||
internal F_Run f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F32 base_align_px, F32 tab_size_px, F_RunFlags flags, String8 string);
|
||||
internal String8List f_wrapped_string_lines_from_font_size_string_max(Arena *arena, F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, String8 string, F32 max);
|
||||
internal Vec2F32 f_dim_from_tag_size_string(F_Tag tag, F32 size, F32 base_align_px, F32 tab_size_px, String8 string);
|
||||
internal Vec2F32 f_dim_from_tag_size_string_list(F_Tag tag, F32 size, F32 base_align_px, F32 tab_size_px, String8List list);
|
||||
internal F32 f_column_size_from_tag_size(F_Tag tag, F32 size);
|
||||
internal U64 f_char_pos_from_tag_size_string_p(F_Tag tag, F32 size, F32 base_align_px, F32 tab_size_px, String8 string, F32 p);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Metrics
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#define UI_HoverCursor(v) DeferLoop(ui_push_hover_cursor(v), ui_pop_hover_cursor())
|
||||
#define UI_Font(v) DeferLoop(ui_push_font(v), ui_pop_font())
|
||||
#define UI_FontSize(v) DeferLoop(ui_push_font_size(v), ui_pop_font_size())
|
||||
#define UI_TabSize(v) DeferLoop(ui_push_tab_size(v), ui_pop_tab_size())
|
||||
#define UI_CornerRadius00(v) DeferLoop(ui_push_corner_radius_00(v), ui_pop_corner_radius_00())
|
||||
#define UI_CornerRadius01(v) DeferLoop(ui_push_corner_radius_01(v), ui_pop_corner_radius_01())
|
||||
#define UI_CornerRadius10(v) DeferLoop(ui_push_corner_radius_10(v), ui_pop_corner_radius_10())
|
||||
@@ -58,6 +59,7 @@ internal F32 ui_top_squish(void) { UI_StackTopImpl(ui_state, Squish, squish) }
|
||||
internal OS_Cursor ui_top_hover_cursor(void) { UI_StackTopImpl(ui_state, HoverCursor, hover_cursor) }
|
||||
internal F_Tag ui_top_font(void) { UI_StackTopImpl(ui_state, Font, font) }
|
||||
internal F32 ui_top_font_size(void) { UI_StackTopImpl(ui_state, FontSize, font_size) }
|
||||
internal F32 ui_top_tab_size(void) { UI_StackTopImpl(ui_state, TabSize, tab_size) }
|
||||
internal F32 ui_top_corner_radius_00(void) { UI_StackTopImpl(ui_state, CornerRadius00, corner_radius_00) }
|
||||
internal F32 ui_top_corner_radius_01(void) { UI_StackTopImpl(ui_state, CornerRadius01, corner_radius_01) }
|
||||
internal F32 ui_top_corner_radius_10(void) { UI_StackTopImpl(ui_state, CornerRadius10, corner_radius_10) }
|
||||
@@ -88,6 +90,7 @@ internal F32 ui_bottom_squish(void) { UI_StackBottomImpl(ui_state, Squish, squis
|
||||
internal OS_Cursor ui_bottom_hover_cursor(void) { UI_StackBottomImpl(ui_state, HoverCursor, hover_cursor) }
|
||||
internal F_Tag ui_bottom_font(void) { UI_StackBottomImpl(ui_state, Font, font) }
|
||||
internal F32 ui_bottom_font_size(void) { UI_StackBottomImpl(ui_state, FontSize, font_size) }
|
||||
internal F32 ui_bottom_tab_size(void) { UI_StackBottomImpl(ui_state, TabSize, tab_size) }
|
||||
internal F32 ui_bottom_corner_radius_00(void) { UI_StackBottomImpl(ui_state, CornerRadius00, corner_radius_00) }
|
||||
internal F32 ui_bottom_corner_radius_01(void) { UI_StackBottomImpl(ui_state, CornerRadius01, corner_radius_01) }
|
||||
internal F32 ui_bottom_corner_radius_10(void) { UI_StackBottomImpl(ui_state, CornerRadius10, corner_radius_10) }
|
||||
@@ -118,6 +121,7 @@ internal F32 ui_push_squish(F32 v) { UI_StackPushImpl(ui_state, Squish, squish,
|
||||
internal OS_Cursor ui_push_hover_cursor(OS_Cursor v) { UI_StackPushImpl(ui_state, HoverCursor, hover_cursor, OS_Cursor, v) }
|
||||
internal F_Tag ui_push_font(F_Tag v) { UI_StackPushImpl(ui_state, Font, font, F_Tag, v) }
|
||||
internal F32 ui_push_font_size(F32 v) { UI_StackPushImpl(ui_state, FontSize, font_size, F32, v) }
|
||||
internal F32 ui_push_tab_size(F32 v) { UI_StackPushImpl(ui_state, TabSize, tab_size, F32, v) }
|
||||
internal F32 ui_push_corner_radius_00(F32 v) { UI_StackPushImpl(ui_state, CornerRadius00, corner_radius_00, F32, v) }
|
||||
internal F32 ui_push_corner_radius_01(F32 v) { UI_StackPushImpl(ui_state, CornerRadius01, corner_radius_01, F32, v) }
|
||||
internal F32 ui_push_corner_radius_10(F32 v) { UI_StackPushImpl(ui_state, CornerRadius10, corner_radius_10, F32, v) }
|
||||
@@ -148,6 +152,7 @@ internal F32 ui_pop_squish(void) { UI_StackPopImpl(ui_state, Squish, squish) }
|
||||
internal OS_Cursor ui_pop_hover_cursor(void) { UI_StackPopImpl(ui_state, HoverCursor, hover_cursor) }
|
||||
internal F_Tag ui_pop_font(void) { UI_StackPopImpl(ui_state, Font, font) }
|
||||
internal F32 ui_pop_font_size(void) { UI_StackPopImpl(ui_state, FontSize, font_size) }
|
||||
internal F32 ui_pop_tab_size(void) { UI_StackPopImpl(ui_state, TabSize, tab_size) }
|
||||
internal F32 ui_pop_corner_radius_00(void) { UI_StackPopImpl(ui_state, CornerRadius00, corner_radius_00) }
|
||||
internal F32 ui_pop_corner_radius_01(void) { UI_StackPopImpl(ui_state, CornerRadius01, corner_radius_01) }
|
||||
internal F32 ui_pop_corner_radius_10(void) { UI_StackPopImpl(ui_state, CornerRadius10, corner_radius_10) }
|
||||
@@ -178,6 +183,7 @@ internal F32 ui_set_next_squish(F32 v) { UI_StackSetNextImpl(ui_state, Squish, s
|
||||
internal OS_Cursor ui_set_next_hover_cursor(OS_Cursor v) { UI_StackSetNextImpl(ui_state, HoverCursor, hover_cursor, OS_Cursor, v) }
|
||||
internal F_Tag ui_set_next_font(F_Tag v) { UI_StackSetNextImpl(ui_state, Font, font, F_Tag, v) }
|
||||
internal F32 ui_set_next_font_size(F32 v) { UI_StackSetNextImpl(ui_state, FontSize, font_size, F32, v) }
|
||||
internal F32 ui_set_next_tab_size(F32 v) { UI_StackSetNextImpl(ui_state, TabSize, tab_size, F32, v) }
|
||||
internal F32 ui_set_next_corner_radius_00(F32 v) { UI_StackSetNextImpl(ui_state, CornerRadius00, corner_radius_00, F32, v) }
|
||||
internal F32 ui_set_next_corner_radius_01(F32 v) { UI_StackSetNextImpl(ui_state, CornerRadius01, corner_radius_01, F32, v) }
|
||||
internal F32 ui_set_next_corner_radius_10(F32 v) { UI_StackSetNextImpl(ui_state, CornerRadius10, corner_radius_10, F32, v) }
|
||||
|
||||
@@ -29,6 +29,7 @@ typedef struct UI_SquishNode UI_SquishNode; struct UI_SquishNode{UI_SquishNode *
|
||||
typedef struct UI_HoverCursorNode UI_HoverCursorNode; struct UI_HoverCursorNode{UI_HoverCursorNode *next; OS_Cursor v;};
|
||||
typedef struct UI_FontNode UI_FontNode; struct UI_FontNode{UI_FontNode *next; F_Tag v;};
|
||||
typedef struct UI_FontSizeNode UI_FontSizeNode; struct UI_FontSizeNode{UI_FontSizeNode *next; F32 v;};
|
||||
typedef struct UI_TabSizeNode UI_TabSizeNode; struct UI_TabSizeNode{UI_TabSizeNode *next; F32 v;};
|
||||
typedef struct UI_CornerRadius00Node UI_CornerRadius00Node; struct UI_CornerRadius00Node{UI_CornerRadius00Node *next; F32 v;};
|
||||
typedef struct UI_CornerRadius01Node UI_CornerRadius01Node; struct UI_CornerRadius01Node{UI_CornerRadius01Node *next; F32 v;};
|
||||
typedef struct UI_CornerRadius10Node UI_CornerRadius10Node; struct UI_CornerRadius10Node{UI_CornerRadius10Node *next; F32 v;};
|
||||
@@ -62,6 +63,7 @@ UI_SquishNode squish_nil_stack_top;\
|
||||
UI_HoverCursorNode hover_cursor_nil_stack_top;\
|
||||
UI_FontNode font_nil_stack_top;\
|
||||
UI_FontSizeNode font_size_nil_stack_top;\
|
||||
UI_TabSizeNode tab_size_nil_stack_top;\
|
||||
UI_CornerRadius00Node corner_radius_00_nil_stack_top;\
|
||||
UI_CornerRadius01Node corner_radius_01_nil_stack_top;\
|
||||
UI_CornerRadius10Node corner_radius_10_nil_stack_top;\
|
||||
@@ -94,6 +96,7 @@ state->squish_nil_stack_top.v = 0;\
|
||||
state->hover_cursor_nil_stack_top.v = OS_Cursor_Pointer;\
|
||||
state->font_nil_stack_top.v = f_tag_zero();\
|
||||
state->font_size_nil_stack_top.v = 24.f;\
|
||||
state->tab_size_nil_stack_top.v = 24.f*4.f;\
|
||||
state->corner_radius_00_nil_stack_top.v = 0;\
|
||||
state->corner_radius_01_nil_stack_top.v = 0;\
|
||||
state->corner_radius_10_nil_stack_top.v = 0;\
|
||||
@@ -128,6 +131,7 @@ struct { UI_SquishNode *top; F32 bottom_val; UI_SquishNode *free; B32 auto_pop;
|
||||
struct { UI_HoverCursorNode *top; OS_Cursor bottom_val; UI_HoverCursorNode *free; B32 auto_pop; } hover_cursor_stack;\
|
||||
struct { UI_FontNode *top; F_Tag bottom_val; UI_FontNode *free; B32 auto_pop; } font_stack;\
|
||||
struct { UI_FontSizeNode *top; F32 bottom_val; UI_FontSizeNode *free; B32 auto_pop; } font_size_stack;\
|
||||
struct { UI_TabSizeNode *top; F32 bottom_val; UI_TabSizeNode *free; B32 auto_pop; } tab_size_stack;\
|
||||
struct { UI_CornerRadius00Node *top; F32 bottom_val; UI_CornerRadius00Node *free; B32 auto_pop; } corner_radius_00_stack;\
|
||||
struct { UI_CornerRadius01Node *top; F32 bottom_val; UI_CornerRadius01Node *free; B32 auto_pop; } corner_radius_01_stack;\
|
||||
struct { UI_CornerRadius10Node *top; F32 bottom_val; UI_CornerRadius10Node *free; B32 auto_pop; } corner_radius_10_stack;\
|
||||
@@ -160,6 +164,7 @@ state->squish_stack.top = &state->squish_nil_stack_top; state->squish_stack.bott
|
||||
state->hover_cursor_stack.top = &state->hover_cursor_nil_stack_top; state->hover_cursor_stack.bottom_val = OS_Cursor_Pointer; state->hover_cursor_stack.free = 0; state->hover_cursor_stack.auto_pop = 0;\
|
||||
state->font_stack.top = &state->font_nil_stack_top; state->font_stack.bottom_val = f_tag_zero(); state->font_stack.free = 0; state->font_stack.auto_pop = 0;\
|
||||
state->font_size_stack.top = &state->font_size_nil_stack_top; state->font_size_stack.bottom_val = 24.f; state->font_size_stack.free = 0; state->font_size_stack.auto_pop = 0;\
|
||||
state->tab_size_stack.top = &state->tab_size_nil_stack_top; state->tab_size_stack.bottom_val = 24.f*4.f; state->tab_size_stack.free = 0; state->tab_size_stack.auto_pop = 0;\
|
||||
state->corner_radius_00_stack.top = &state->corner_radius_00_nil_stack_top; state->corner_radius_00_stack.bottom_val = 0; state->corner_radius_00_stack.free = 0; state->corner_radius_00_stack.auto_pop = 0;\
|
||||
state->corner_radius_01_stack.top = &state->corner_radius_01_nil_stack_top; state->corner_radius_01_stack.bottom_val = 0; state->corner_radius_01_stack.free = 0; state->corner_radius_01_stack.auto_pop = 0;\
|
||||
state->corner_radius_10_stack.top = &state->corner_radius_10_nil_stack_top; state->corner_radius_10_stack.bottom_val = 0; state->corner_radius_10_stack.free = 0; state->corner_radius_10_stack.auto_pop = 0;\
|
||||
@@ -192,6 +197,7 @@ if(state->squish_stack.auto_pop) { ui_pop_squish(); state->squish_stack.auto_pop
|
||||
if(state->hover_cursor_stack.auto_pop) { ui_pop_hover_cursor(); state->hover_cursor_stack.auto_pop = 0; }\
|
||||
if(state->font_stack.auto_pop) { ui_pop_font(); state->font_stack.auto_pop = 0; }\
|
||||
if(state->font_size_stack.auto_pop) { ui_pop_font_size(); state->font_size_stack.auto_pop = 0; }\
|
||||
if(state->tab_size_stack.auto_pop) { ui_pop_tab_size(); state->tab_size_stack.auto_pop = 0; }\
|
||||
if(state->corner_radius_00_stack.auto_pop) { ui_pop_corner_radius_00(); state->corner_radius_00_stack.auto_pop = 0; }\
|
||||
if(state->corner_radius_01_stack.auto_pop) { ui_pop_corner_radius_01(); state->corner_radius_01_stack.auto_pop = 0; }\
|
||||
if(state->corner_radius_10_stack.auto_pop) { ui_pop_corner_radius_10(); state->corner_radius_10_stack.auto_pop = 0; }\
|
||||
@@ -223,6 +229,7 @@ internal F32 ui_top_squish(void);
|
||||
internal OS_Cursor ui_top_hover_cursor(void);
|
||||
internal F_Tag ui_top_font(void);
|
||||
internal F32 ui_top_font_size(void);
|
||||
internal F32 ui_top_tab_size(void);
|
||||
internal F32 ui_top_corner_radius_00(void);
|
||||
internal F32 ui_top_corner_radius_01(void);
|
||||
internal F32 ui_top_corner_radius_10(void);
|
||||
@@ -253,6 +260,7 @@ internal F32 ui_bottom_squish(void);
|
||||
internal OS_Cursor ui_bottom_hover_cursor(void);
|
||||
internal F_Tag ui_bottom_font(void);
|
||||
internal F32 ui_bottom_font_size(void);
|
||||
internal F32 ui_bottom_tab_size(void);
|
||||
internal F32 ui_bottom_corner_radius_00(void);
|
||||
internal F32 ui_bottom_corner_radius_01(void);
|
||||
internal F32 ui_bottom_corner_radius_10(void);
|
||||
@@ -283,6 +291,7 @@ internal F32 ui_push_squish(F32 v);
|
||||
internal OS_Cursor ui_push_hover_cursor(OS_Cursor v);
|
||||
internal F_Tag ui_push_font(F_Tag v);
|
||||
internal F32 ui_push_font_size(F32 v);
|
||||
internal F32 ui_push_tab_size(F32 v);
|
||||
internal F32 ui_push_corner_radius_00(F32 v);
|
||||
internal F32 ui_push_corner_radius_01(F32 v);
|
||||
internal F32 ui_push_corner_radius_10(F32 v);
|
||||
@@ -313,6 +322,7 @@ internal F32 ui_pop_squish(void);
|
||||
internal OS_Cursor ui_pop_hover_cursor(void);
|
||||
internal F_Tag ui_pop_font(void);
|
||||
internal F32 ui_pop_font_size(void);
|
||||
internal F32 ui_pop_tab_size(void);
|
||||
internal F32 ui_pop_corner_radius_00(void);
|
||||
internal F32 ui_pop_corner_radius_01(void);
|
||||
internal F32 ui_pop_corner_radius_10(void);
|
||||
@@ -343,6 +353,7 @@ internal F32 ui_set_next_squish(F32 v);
|
||||
internal OS_Cursor ui_set_next_hover_cursor(OS_Cursor v);
|
||||
internal F_Tag ui_set_next_font(F_Tag v);
|
||||
internal F32 ui_set_next_font_size(F32 v);
|
||||
internal F32 ui_set_next_tab_size(F32 v);
|
||||
internal F32 ui_set_next_corner_radius_00(F32 v);
|
||||
internal F32 ui_set_next_corner_radius_01(F32 v);
|
||||
internal F32 ui_set_next_corner_radius_10(F32 v);
|
||||
|
||||
@@ -46,6 +46,7 @@ UI_StackTable:
|
||||
//- rjf: font
|
||||
{ Font font F_Tag `f_tag_zero()` }
|
||||
{ FontSize font_size F32 24.f }
|
||||
{ TabSize tab_size F32 `24.f*4.f` }
|
||||
|
||||
//- rjf: corner radii
|
||||
{ CornerRadius00 corner_radius_00 F32 0 }
|
||||
|
||||
@@ -43,7 +43,7 @@ ui_label_multiline(F32 max, String8 string)
|
||||
ui_set_next_child_layout_axis(Axis2_Y);
|
||||
ui_set_next_pref_height(ui_children_sum(1));
|
||||
UI_Box *box = ui_build_box_from_key(0, ui_key_zero());
|
||||
String8List lines = f_wrapped_string_lines_from_font_size_string_max(scratch.arena, ui_top_font(), ui_top_font_size(), 0, UI_TEMP_TAB_WIDTH, string, max);
|
||||
String8List lines = f_wrapped_string_lines_from_font_size_string_max(scratch.arena, ui_top_font(), ui_top_font_size(), 0, ui_top_tab_size(), string, max);
|
||||
for(String8Node *n = lines.first; n != 0; n = n->next)
|
||||
{
|
||||
ui_label(n->string);
|
||||
@@ -131,6 +131,7 @@ internal UI_BOX_CUSTOM_DRAW(ui_line_edit_draw)
|
||||
UI_LineEditDrawData *draw_data = (UI_LineEditDrawData *)user_data;
|
||||
F_Tag font = box->font;
|
||||
F32 font_size = box->font_size;
|
||||
F32 tab_size = box->tab_size;
|
||||
Vec4F32 cursor_color = draw_data->cursor_color;
|
||||
cursor_color.w *= box->parent->parent->focus_active_t;
|
||||
Vec4F32 select_color = draw_data->select_color;
|
||||
@@ -139,8 +140,8 @@ internal UI_BOX_CUSTOM_DRAW(ui_line_edit_draw)
|
||||
String8 edited_string = draw_data->edited_string;
|
||||
TxtPt cursor = draw_data->cursor;
|
||||
TxtPt mark = draw_data->mark;
|
||||
F32 cursor_pixel_off = f_dim_from_tag_size_string(font, font_size, 0, UI_TEMP_TAB_WIDTH, str8_prefix(edited_string, cursor.column-1)).x + font_size/8.f;
|
||||
F32 mark_pixel_off = f_dim_from_tag_size_string(font, font_size, 0, UI_TEMP_TAB_WIDTH, str8_prefix(edited_string, mark.column-1)).x + font_size/8.f;
|
||||
F32 cursor_pixel_off = f_dim_from_tag_size_string(font, font_size, 0, tab_size, str8_prefix(edited_string, cursor.column-1)).x + font_size/8.f;
|
||||
F32 mark_pixel_off = f_dim_from_tag_size_string(font, font_size, 0, tab_size, str8_prefix(edited_string, mark.column-1)).x + font_size/8.f;
|
||||
F32 cursor_thickness = ClampBot(4.f, font_size/6.f);
|
||||
Rng2F32 cursor_rect =
|
||||
{
|
||||
@@ -253,7 +254,7 @@ ui_line_edit(TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size,
|
||||
}
|
||||
else
|
||||
{
|
||||
F32 total_text_width = f_dim_from_tag_size_string(ui_top_font(), ui_top_font_size(), 0, UI_TEMP_TAB_WIDTH, edit_string).x;
|
||||
F32 total_text_width = f_dim_from_tag_size_string(ui_top_font(), ui_top_font_size(), 0, ui_top_tab_size(), edit_string).x;
|
||||
ui_set_next_pref_width(ui_px(total_text_width+ui_top_font_size()*5, 1.f));
|
||||
UI_Box *editstr_box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_DisableTextTrunc, "###editstr");
|
||||
UI_LineEditDrawData *draw_data = push_array(ui_build_arena(), UI_LineEditDrawData, 1);
|
||||
@@ -265,7 +266,7 @@ ui_line_edit(TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size,
|
||||
ui_box_equip_display_string(editstr_box, edit_string);
|
||||
ui_box_equip_custom_draw(editstr_box, ui_line_edit_draw, draw_data);
|
||||
mouse_pt = txt_pt(1, 1+ui_box_char_pos_from_xy(editstr_box, ui_mouse()));
|
||||
cursor_off = f_dim_from_tag_size_string(ui_top_font(), ui_top_font_size(), 0, UI_TEMP_TAB_WIDTH, str8_prefix(edit_string, cursor->column-1)).x;
|
||||
cursor_off = f_dim_from_tag_size_string(ui_top_font(), ui_top_font_size(), 0, ui_top_tab_size(), str8_prefix(edit_string, cursor->column-1)).x;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-6
@@ -2170,6 +2170,7 @@ ui_build_box_from_key(UI_BoxFlags flags, UI_Key key)
|
||||
box->overlay_color = ui_state->overlay_color_stack.top->v;
|
||||
box->font = ui_state->font_stack.top->v;
|
||||
box->font_size = ui_state->font_size_stack.top->v;
|
||||
box->tab_size = ui_state->tab_size_stack.top->v;
|
||||
box->corner_radii[Corner_00] = ui_state->corner_radius_00_stack.top->v;
|
||||
box->corner_radii[Corner_01] = ui_state->corner_radius_01_stack.top->v;
|
||||
box->corner_radii[Corner_10] = ui_state->corner_radius_10_stack.top->v;
|
||||
@@ -2258,7 +2259,7 @@ ui_box_equip_display_string(UI_Box *box, String8 string)
|
||||
String8 display_string = ui_box_display_string(box);
|
||||
D_FancyStringNode fancy_string_n = {0, {box->font, display_string, box->text_color, box->font_size, 0, 0}};
|
||||
D_FancyStringList fancy_strings = {&fancy_string_n, &fancy_string_n, 1};
|
||||
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), UI_TEMP_TAB_WIDTH, &fancy_strings);
|
||||
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, &fancy_strings);
|
||||
}
|
||||
else if(box->flags & UI_BoxFlag_DrawText && box->flags & UI_BoxFlag_DrawTextFastpathCodepoint && box->fastpath_codepoint != 0)
|
||||
{
|
||||
@@ -2273,13 +2274,13 @@ ui_box_equip_display_string(UI_Box *box, String8 string)
|
||||
D_FancyStringNode cdp_fancy_string_n = {&pst_fancy_string_n, {box->font, str8_substr(display_string, r1u64(fpcp_pos, fpcp_pos+fpcp.size)), box->text_color, box->font_size, 4.f, 0}};
|
||||
D_FancyStringNode pre_fancy_string_n = {&cdp_fancy_string_n, {box->font, str8_prefix(display_string, fpcp_pos), box->text_color, box->font_size, 0, 0}};
|
||||
D_FancyStringList fancy_strings = {&pre_fancy_string_n, &pst_fancy_string_n, 3};
|
||||
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), UI_TEMP_TAB_WIDTH, &fancy_strings);
|
||||
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, &fancy_strings);
|
||||
}
|
||||
else
|
||||
{
|
||||
D_FancyStringNode fancy_string_n = {0, {box->font, display_string, box->text_color, box->font_size, 0, 0}};
|
||||
D_FancyStringList fancy_strings = {&fancy_string_n, &fancy_string_n, 1};
|
||||
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), UI_TEMP_TAB_WIDTH, &fancy_strings);
|
||||
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, &fancy_strings);
|
||||
}
|
||||
scratch_end(scratch);
|
||||
}
|
||||
@@ -2287,11 +2288,11 @@ ui_box_equip_display_string(UI_Box *box, String8 string)
|
||||
}
|
||||
|
||||
internal void
|
||||
ui_box_equip_display_fancy_strings(UI_Box *box, D_FancyStringList *strings)
|
||||
ui_box_equip_display_fancy_strings(UI_Box *box, F32 tab_size, D_FancyStringList *strings)
|
||||
{
|
||||
box->flags |= UI_BoxFlag_HasDisplayString;
|
||||
box->string = d_string_from_fancy_string_list(ui_build_arena(), strings);
|
||||
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), UI_TEMP_TAB_WIDTH, strings);
|
||||
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), tab_size, strings);
|
||||
}
|
||||
|
||||
internal inline void
|
||||
@@ -2381,7 +2382,7 @@ ui_box_char_pos_from_xy(UI_Box *box, Vec2F32 xy)
|
||||
F_Tag font = box->font;
|
||||
F32 font_size = box->font_size;
|
||||
String8 line = ui_box_display_string(box);
|
||||
U64 result = f_char_pos_from_tag_size_string_p(font, font_size, 0, UI_TEMP_TAB_WIDTH, line, xy.x - ui_box_text_position(box).x);
|
||||
U64 result = f_char_pos_from_tag_size_string_p(font, font_size, 0, box->tab_size, line, xy.x - ui_box_text_position(box).x);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
+3
-5
@@ -4,10 +4,6 @@
|
||||
#ifndef UI_H
|
||||
#define UI_H
|
||||
|
||||
// TODO(rjf): @tab_layout
|
||||
#define UI_TEMP_TAB_WIDTH 4.f
|
||||
#define UI_TEMP_BASE_COLUMN_TODO 0.f
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Icon Info
|
||||
|
||||
@@ -340,6 +336,7 @@ struct UI_Box
|
||||
Vec4F32 overlay_color;
|
||||
F_Tag font;
|
||||
F32 font_size;
|
||||
F32 tab_size;
|
||||
F32 corner_radii[Corner_COUNT];
|
||||
F32 blur_size;
|
||||
F32 transparency;
|
||||
@@ -731,7 +728,7 @@ internal UI_Box * ui_build_box_from_stringf(UI_BoxFlags flags, char *fm
|
||||
|
||||
//- rjf: box node equipment
|
||||
internal inline void ui_box_equip_display_string(UI_Box *box, String8 string);
|
||||
internal inline void ui_box_equip_display_fancy_strings(UI_Box *box, D_FancyStringList *strings);
|
||||
internal inline void ui_box_equip_display_fancy_strings(UI_Box *box, F32 tab_size, D_FancyStringList *strings);
|
||||
internal inline void ui_box_equip_display_string_fancy_runs(UI_Box *box, String8 string, D_FancyRunList *runs);
|
||||
internal inline void ui_box_equip_fuzzy_match_ranges(UI_Box *box, FuzzyMatchRangeList *matches);
|
||||
internal inline void ui_box_equip_draw_bucket(UI_Box *box, D_Bucket *bucket);
|
||||
@@ -942,6 +939,7 @@ internal void ui_pop_corner_radius(void);
|
||||
#define UI_HoverCursor(v) DeferLoop(ui_push_hover_cursor(v), ui_pop_hover_cursor())
|
||||
#define UI_Font(v) DeferLoop(ui_push_font(v), ui_pop_font())
|
||||
#define UI_FontSize(v) DeferLoop(ui_push_font_size(v), ui_pop_font_size())
|
||||
#define UI_TabSize(v) DeferLoop(ui_push_tab_size(v), ui_pop_tab_size())
|
||||
#define UI_CornerRadius00(v) DeferLoop(ui_push_corner_radius_00(v), ui_pop_corner_radius_00())
|
||||
#define UI_CornerRadius01(v) DeferLoop(ui_push_corner_radius_01(v), ui_pop_corner_radius_01())
|
||||
#define UI_CornerRadius10(v) DeferLoop(ui_push_corner_radius_10(v), ui_pop_corner_radius_10())
|
||||
|
||||
Reference in New Issue
Block a user