@@ -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 ; };
@@ -448,14 +448,13 @@ namespace rs2
448448 void stream_model::show_stream_header (ImFont* font, const rect &stream_rect, viewer_model& viewer)
449449 {
450450 const auto top_bar_height = 32 .f ;
451- auto num_of_buttons = 5 ;
451+ auto num_of_buttons = 6 ; // Crosshair button is the latest addition
452452
453453 if (!viewer.allow_stream_close ) --num_of_buttons;
454454 if (viewer.streams .size () > 1 ) ++num_of_buttons;
455455 if (RS2_STREAM_DEPTH == profile.stream_type ()) ++num_of_buttons; // Color map ruler button
456456 if (RS2_FORMAT_MOTION_XYZ32F == profile.format ()) ++num_of_buttons; // Motion graph button
457457 if (RS2_STREAM_OCCUPANCY == profile.stream_type () && _normalized_zoom.w == 1 ) ++num_of_buttons; // Safety zones button
458- ++num_of_buttons; // Grid overlay button
459458
460459 RsImGui_ScopePushFont (font);
461460 ImGui::PushStyleColor (ImGuiCol_Text, light_grey);
@@ -592,23 +591,23 @@ namespace rs2
592591 ImGui::SameLine ();
593592
594593 label = rsutils::string::from () << textual_icons::grid << " ##Grid " << profile.unique_id ();
595- if (show_grid )
594+ if (show_crosshair )
596595 {
597596 ImGui::PushStyleColor (ImGuiCol_Text, light_blue);
598597 ImGui::PushStyleColor (ImGuiCol_TextSelectedBg, light_blue);
599598 if (ImGui::Button (label.c_str (), { 24 , top_bar_height }))
600599 {
601- show_grid = false ;
600+ show_crosshair = false ;
602601 }
603602 if (ImGui::IsItemHovered ())
604- RsImGui::CustomTooltip (" Hide crosshair/grid overlay" );
603+ RsImGui::CustomTooltip (" Hide crosshair overlay" );
605604 ImGui::PopStyleColor (2 );
606605 }
607606 else
608607 {
609608 if (ImGui::Button (label.c_str (), { 24 , top_bar_height }))
610609 {
611- show_grid = true ;
610+ show_crosshair = true ;
612611 }
613612 if (ImGui::IsItemHovered ())
614613 RsImGui::CustomTooltip (" Show crosshair/grid overlay" );
@@ -2105,7 +2104,7 @@ namespace rs2
21052104
21062105 update_ae_roi_rect (stream_rect, g, error_message);
21072106
2108- if (show_grid )
2107+ if (show_crosshair )
21092108 draw_crosshair (stream_rect, grid_h_lines, grid_v_lines, grid_line_width,
21102109 grid_color_r, grid_color_g, grid_color_b);
21112110
0 commit comments