diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 7c2c4eba..6cbed85d 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -10501,6 +10501,14 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ UI_Box *margin_container_box = &ui_g_nil_box; if(params->flags & DF_CodeSliceFlag_Margin) UI_Focus(UI_FocusKind_Off) UI_Parent(top_container_box) ProfScope("build margins") { + if(params->margin_float_off_px != 0) + { + ui_set_next_pref_width(ui_px(params->margin_width_px, 1)); + ui_set_next_pref_height(ui_px(params->line_height_px*(dim_1s64(params->line_num_range)+1), 1.f)); + ui_build_box_from_key(0, ui_key_zero()); + ui_set_next_fixed_x(params->margin_float_off_px); + ui_set_next_flags(UI_BoxFlag_DrawBackground); + } ui_set_next_pref_width(ui_px(params->margin_width_px, 1)); ui_set_next_pref_height(ui_px(params->line_height_px*(dim_1s64(params->line_num_range)+1), 1.f)); ui_set_next_child_layout_axis(Axis2_Y); @@ -11291,9 +11299,20 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ TxtRng select_rng = txt_rng(*cursor, *mark); Vec4F32 inactive_color = df_rgba_from_theme_color(DF_ThemeColor_WeakText); Vec4F32 active_color = df_rgba_from_theme_color(DF_ThemeColor_PlainText); + if(params->margin_float_off_px != 0) + { + ui_set_next_pref_width(ui_px(params->line_num_width_px, 1.f)); + ui_set_next_pref_height(ui_px(params->line_height_px*(dim_1s64(params->line_num_range)+1), 1.f)); + ui_build_box_from_key(0, ui_key_zero()); + ui_set_next_fixed_x(params->margin_float_off_px); + ui_set_next_flags(UI_BoxFlag_DrawDropShadow|UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawSideRight|UI_BoxFlag_DrawSideLeft); + } + else + { + ui_set_next_flags(UI_BoxFlag_DrawSideRight|UI_BoxFlag_DrawSideLeft); + } ui_set_next_pref_width(ui_px(params->line_num_width_px, 1.f)); ui_set_next_pref_height(ui_px(params->line_height_px*(dim_1s64(params->line_num_range)+1), 1.f)); - ui_set_next_flags(UI_BoxFlag_DrawSideRight|UI_BoxFlag_DrawSideLeft); UI_Column UI_PrefHeight(ui_px(params->line_height_px, 1.f)) UI_Font(params->font) diff --git a/src/df/gfx/df_gfx.h b/src/df/gfx/df_gfx.h index 83c79ce6..a7c1b964 100644 --- a/src/df/gfx/df_gfx.h +++ b/src/df/gfx/df_gfx.h @@ -416,6 +416,7 @@ struct DF_CodeSliceParams F32 line_num_width_px; F32 line_text_max_width_px; DF_EntityList flash_ranges; + F32 margin_float_off_px; }; typedef struct DF_CodeSliceSignal DF_CodeSliceSignal; diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index 20731bed..a667c053 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -5411,6 +5411,11 @@ DF_VIEW_UI_FUNCTION_DEF(Code) code_slice_params.line_num_width_px = line_num_width_px; code_slice_params.line_text_max_width_px = (F32)line_size_x; code_slice_params.flash_ranges = df_push_entity_child_list_with_kind(scratch.arena, entity, DF_EntityKind_FlashMarker); + code_slice_params.margin_float_off_px = view->scroll_pos.x.idx + view->scroll_pos.x.off; + if(code_slice_params.margin_float_off_px < 1) + { + code_slice_params.margin_float_off_px = 0; + } // rjf: fill text info { @@ -6494,6 +6499,11 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) code_slice_params.line_num_width_px = line_num_width_px; code_slice_params.line_text_max_width_px = (F32)line_size_x; code_slice_params.flash_ranges = df_push_entity_child_list_with_kind(scratch.arena, process, DF_EntityKind_FlashMarker); + code_slice_params.margin_float_off_px = view->scroll_pos.x.idx + view->scroll_pos.x.off; + if(code_slice_params.margin_float_off_px < 1) + { + code_slice_params.margin_float_off_px = 0; + } df_entity_list_push(scratch.arena, &code_slice_params.relevant_binaries, binary); // rjf: fill text info @@ -7329,6 +7339,11 @@ DF_VIEW_UI_FUNCTION_DEF(Output) code_slice_params.line_num_width_px = line_num_width_px; code_slice_params.line_text_max_width_px = (F32)line_size_x; code_slice_params.flash_ranges = df_push_entity_child_list_with_kind(scratch.arena, entity, DF_EntityKind_FlashMarker); + code_slice_params.margin_float_off_px = view->scroll_pos.x.idx + view->scroll_pos.x.off; + if(code_slice_params.margin_float_off_px < 1) + { + code_slice_params.margin_float_off_px = 0; + } } ////////////////////////////// diff --git a/src/raddbg/raddbg.h b/src/raddbg/raddbg.h index 76d0b1d1..ecc89863 100644 --- a/src/raddbg/raddbg.h +++ b/src/raddbg/raddbg.h @@ -4,6 +4,8 @@ //////////////////////////////// //~ rjf: Frontend/UI Pass Tasks // +// [ ] editing multiple bindings for commands +// // [ ] n-row table selection, in watch window & other UIs, multi-selection // ctrl+C // [x] UI_NavActions, OS_Event -> UI_Event (single event stream) @@ -11,7 +13,7 @@ // [ ] better discoverability for view rules - have better help hover tooltip, // info on arguments, and better autocomplete lister // -// [ ] source view -> floating margin/line-nums +// [x] source view -> floating margin/line-nums // [ ] theme colors -> more explicit about e.g. opaque backgrounds vs. floating // & scrollbars etc. // [ ] target/breakpoint/watch-pin reordering