@@ -31,7 +31,7 @@ namespace rs2
3131 show_safety_zones_2d = config_file::instance ().get_or_default (
3232 configurations::viewer::show_safety_zones_2d, true );
3333 {
34- namespace cfg = configurations::viewer::viewport_grid ;
34+ namespace cfg = configurations::viewer::viewport_grid_overlay ;
3535 auto & cf = config_file::instance ();
3636
3737 auto valid_lines = []( int v ) { return ( v >= 1 && v <= 5 ) ? v : 1 ; };
@@ -453,14 +453,13 @@ namespace rs2
453453 void stream_model::show_stream_header (ImFont* font, const rect &stream_rect, viewer_model& viewer)
454454 {
455455 const auto top_bar_height = 32 .f ;
456- auto num_of_buttons = 5 ;
456+ auto num_of_buttons = 6 ; // Crosshair button is the latest addition
457457
458458 if (!viewer.allow_stream_close ) --num_of_buttons;
459459 if (viewer.streams .size () > 1 ) ++num_of_buttons;
460460 if (RS2_STREAM_DEPTH == profile.stream_type ()) ++num_of_buttons; // Color map ruler button
461461 if (RS2_FORMAT_MOTION_XYZ32F == profile.format ()) ++num_of_buttons; // Motion graph button
462462 if (RS2_STREAM_OCCUPANCY == profile.stream_type () && _normalized_zoom.w == 1 ) ++num_of_buttons; // Safety zones button
463- ++num_of_buttons; // Grid overlay button
464463
465464 RsImGui_ScopePushFont (font);
466465 ImGui::PushStyleColor (ImGuiCol_Text, light_grey);
@@ -601,23 +600,23 @@ namespace rs2
601600 ImGui::SameLine ();
602601
603602 label = rsutils::string::from () << textual_icons::grid << " ##Grid " << profile.unique_id ();
604- if (show_grid )
603+ if (show_crosshair )
605604 {
606605 ImGui::PushStyleColor (ImGuiCol_Text, light_blue);
607606 ImGui::PushStyleColor (ImGuiCol_TextSelectedBg, light_blue);
608607 if (ImGui::Button (label.c_str (), { 24 , top_bar_height }))
609608 {
610- show_grid = false ;
609+ show_crosshair = false ;
611610 }
612611 if (ImGui::IsItemHovered ())
613- RsImGui::CustomTooltip (" Hide crosshair/grid overlay" );
612+ RsImGui::CustomTooltip (" Hide crosshair overlay" );
614613 ImGui::PopStyleColor (2 );
615614 }
616615 else
617616 {
618617 if (ImGui::Button (label.c_str (), { 24 , top_bar_height }))
619618 {
620- show_grid = true ;
619+ show_crosshair = true ;
621620 }
622621 if (ImGui::IsItemHovered ())
623622 RsImGui::CustomTooltip (" Show crosshair/grid overlay" );
@@ -2114,7 +2113,7 @@ namespace rs2
21142113
21152114 update_ae_roi_rect (stream_rect, g, error_message);
21162115
2117- if (show_grid )
2116+ if (show_crosshair )
21182117 draw_crosshair (stream_rect, grid_h_lines, grid_v_lines, grid_line_width,
21192118 grid_color_r, grid_color_g, grid_color_b);
21202119
0 commit comments