Skip to content

Commit

Permalink
PR #13693 from Noy-Zini: replace SetTooltip with CustomTooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az authored Jan 22, 2025
2 parents c346fb0 + e6f22de commit 5b40a7e
Show file tree
Hide file tree
Showing 18 changed files with 76 additions and 55 deletions.
2 changes: 1 addition & 1 deletion common/d500-on-chip-calib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ namespace rs2
}
if (ImGui::IsItemHovered())
{
ImGui::SetTooltip("Abort Calibration Process");
RsImGui::CustomTooltip("Abort Calibration Process");
}
}

Expand Down
8 changes: 4 additions & 4 deletions common/dds-model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ void dds_model::render_dds_config_window( ux_window & window, std::string & erro
if( ImGui::IsItemHovered() )
{
window.link_hovered();
ImGui::SetTooltip( "%s", "Close without saving any changes" );
RsImGui::CustomTooltip( "%s", "Close without saving any changes" );
}
ImGui::SameLine();
if( ImGui::Button( "Factory Reset", ImVec2( button_width, 25 ) ) )
Expand All @@ -314,7 +314,7 @@ void dds_model::render_dds_config_window( ux_window & window, std::string & erro
if( ImGui::IsItemHovered() )
{
window.link_hovered();
ImGui::SetTooltip( "%s", "Reset settings back to defult values" );
RsImGui::CustomTooltip( "%s", "Reset settings back to defult values" );
}
ImGui::SameLine();
RsImGui::RsImButton(
Expand All @@ -329,7 +329,7 @@ void dds_model::render_dds_config_window( ux_window & window, std::string & erro
if( ImGui::IsItemHovered() )
{
window.link_hovered();
ImGui::SetTooltip( "%s", "Revert to current configuration values" );
RsImGui::CustomTooltip( "%s", "Revert to current configuration values" );
}
ImGui::SameLine();
RsImGui::RsImButton(
Expand All @@ -345,7 +345,7 @@ void dds_model::render_dds_config_window( ux_window & window, std::string & erro
if( ImGui::IsItemHovered() )
{
window.link_hovered();
ImGui::SetTooltip( "%s", "Apply changes" );
RsImGui::CustomTooltip( "%s", "Apply changes" );
}
if( ImGui::BeginPopupModal( "No Changes Needed", NULL, ImGuiWindowFlags_AlwaysAutoResize ) )
{
Expand Down
8 changes: 4 additions & 4 deletions common/device-model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,7 @@ namespace rs2
std::string tooltip = rsutils::string::from()
<< "Change the configuration of Ethernet based devices"
<< ( is_streaming ? " (Disabled while streaming)" : "" );
ImGui::SetTooltip( "%s", tooltip.c_str() );
RsImGui::CustomTooltip( "%s", tooltip.c_str() );
}
}
}
Expand Down Expand Up @@ -2266,7 +2266,7 @@ namespace rs2
ImGui::PushFont(window.get_font());
ImGui::PushStyleColor(ImGuiCol_Text, light_grey);
if (ImGui::IsItemHovered())
ImGui::SetTooltip(" %s", ss.str().c_str());
RsImGui::CustomTooltip(" %s", ss.str().c_str());
ImGui::PopStyleColor();
ImGui::PopFont();
}
Expand Down Expand Up @@ -3227,7 +3227,7 @@ namespace rs2
}

if (ImGui::IsItemHovered())
ImGui::SetTooltip("UV-Mapping calibration is used to improve UV-Mapping with specific target.");
RsImGui::CustomTooltip("UV-Mapping calibration is used to improve UV-Mapping with specific target.");
}
}
}
Expand Down Expand Up @@ -3279,7 +3279,7 @@ namespace rs2
// }
//}
//if (ImGui::IsItemHovered())
// ImGui::SetTooltip("Focal length plus calibration is used to adjust camera focal length and principal points with specific target.");
// RsImGui::CustomTooltip("Focal length plus calibration is used to adjust camera focal length and principal points with specific target.");

if (_calib_model.supports())
{
Expand Down
2 changes: 1 addition & 1 deletion common/measurement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ void measurement::show_tooltip(ux_window& win)
{
std::string tt = rsutils::string::from() << std::fixed << std::setprecision(3)
<< _picked.x << ", " << _picked.y << ", " << _picked.z << " meters";
ImGui::SetTooltip("%s", tt.c_str());
RsImGui::CustomTooltip("%s", tt.c_str());
}
}
}
1 change: 1 addition & 0 deletions common/model-views.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <GLFW/glfw3.h>
#include "opengl3.h"
#include <imgui.h>
#include <realsense_imgui.h>
#include <imgui_impl_glfw.h>
#include <map>
#include <set>
Expand Down
6 changes: 3 additions & 3 deletions common/on-chip-calib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2165,7 +2165,7 @@ namespace rs2
if (ImGui::Checkbox("Adjust both sides focal length", &restore))
get_manager().adjust_both_sides = (restore ? 1 : 0);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("%s", "check = adjust both sides, uncheck = adjust right side only");
RsImGui::CustomTooltip("%s", "check = adjust both sides, uncheck = adjust right side only");
}*/

// Deprecase OCC-Extended
Expand All @@ -2176,13 +2176,13 @@ namespace rs2
//if (ImGui::RadioButton("OCC", (int*)&(get_manager().action), 1))
// get_manager().action = on_chip_calib_manager::RS2_CALIB_ACTION_ON_CHIP_CALIB;
//if (ImGui::IsItemHovered())
// ImGui::SetTooltip("%s", "On-chip calibration");
// RsImGui::CustomTooltip("%s", "On-chip calibration");

//ImGui::SetCursorScreenPos({ float(x + 135), tmp_y });
//if (ImGui::RadioButton("OCC Extended", (int *)&(get_manager().action), 0))
// get_manager().action = on_chip_calib_manager::RS2_CALIB_ACTION_ON_CHIP_OB_CALIB;
//if (ImGui::IsItemHovered())
// ImGui::SetTooltip("%s", "On-Chip Calibration Extended");
// RsImGui::CustomTooltip("%s", "On-Chip Calibration Extended");

ImGui::SetCursorScreenPos({ float(x + 9), float(y + height - ImGui::GetTextLineHeightWithSpacing() - 31) });
get_manager().host_assistance = (get_manager().device_name_string == std::string("Intel RealSense D457") ); // To be used for MIPI SKU only
Expand Down
22 changes: 11 additions & 11 deletions common/output-model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ bool output_model::round_indicator(ux_window& win, std::string icon,
{
highlighted = true;
win.link_hovered();
ImGui::SetTooltip("%s", tooltip.c_str());
RsImGui::CustomTooltip("%s", tooltip.c_str());
}
else highlighted = false;

Expand Down Expand Up @@ -242,7 +242,7 @@ void output_model::draw(ux_window& win, rect view_rect, device_models_list & dev
if (ImGui::IsItemHovered())
{
win.link_hovered();
ImGui::SetTooltip("%s", "Open Debug Console Window");
RsImGui::CustomTooltip("%s", "Open Debug Console Window");
}

if (default_log_h.value() != 36)
Expand All @@ -261,7 +261,7 @@ void output_model::draw(ux_window& win, rect view_rect, device_models_list & dev
if (ImGui::IsItemHovered())
{
win.link_hovered();
ImGui::SetTooltip("%s", "Collapse Debug Console Window");
RsImGui::CustomTooltip("%s", "Collapse Debug Console Window");
}

int h_val = (int)((win.height() - 100) / 2);
Expand Down Expand Up @@ -315,7 +315,7 @@ void output_model::draw(ux_window& win, rect view_rect, device_models_list & dev
if (ImGui::IsItemHovered())
{
win.link_hovered();
ImGui::SetTooltip("%s", "Search through logs");
RsImGui::CustomTooltip("%s", "Search through logs");
}
ImGui::SameLine();

Expand All @@ -327,7 +327,7 @@ void output_model::draw(ux_window& win, rect view_rect, device_models_list & dev
}
if( ImGui::IsItemHovered() )
{
ImGui::SetTooltip( "%s", "Set maximum number of log entries kept" );
RsImGui::CustomTooltip( "%s", "Set maximum number of log entries kept" );
}
ImGui::PopStyleColor(1);
ImGui::SameLine();
Expand Down Expand Up @@ -421,8 +421,8 @@ void output_model::draw(ux_window& win, rect view_rect, device_models_list & dev
if (ImGui::IsItemHovered())
{
win.link_hovered();
if (enable_firmware_logs) ImGui::SetTooltip("%s", "Disable Firmware Logs");
else ImGui::SetTooltip("%s", "Enable Firmware Logs");
if (enable_firmware_logs) RsImGui::CustomTooltip("%s", "Disable Firmware Logs");
else RsImGui::CustomTooltip("%s", "Enable Firmware Logs");
}
ImGui::SameLine();

Expand Down Expand Up @@ -703,7 +703,7 @@ void output_model::draw(ux_window& win, rect view_rect, device_models_list & dev
}
if( ImGui::IsItemHovered() )
{
ImGui::SetTooltip( "Collapse dashboard" );
RsImGui::CustomTooltip( "Collapse dashboard" );
}

// Animation of opening dashboard panel
Expand All @@ -723,7 +723,7 @@ void output_model::draw(ux_window& win, rect view_rect, device_models_list & dev
}
if( ImGui::IsItemHovered() )
{
ImGui::SetTooltip( "Open dashboard" );
RsImGui::CustomTooltip( "Open dashboard" );
}
ImGui::SetCursorPosX( cursor_pos_x );

Expand Down Expand Up @@ -772,7 +772,7 @@ void output_model::draw(ux_window& win, rect view_rect, device_models_list & dev

if (ImGui::IsItemHovered())
{
ImGui::SetTooltip("Add one of the available stream dashboards to view");
RsImGui::CustomTooltip("Add one of the available stream dashboards to view");
win.link_hovered();
}

Expand Down Expand Up @@ -1125,7 +1125,7 @@ void stream_dashboard::draw_dashboard(ux_window& win, rect& r)
}
if (ImGui::IsItemHovered())
{
ImGui::SetTooltip("Remove Dashboard from View");
RsImGui::CustomTooltip("Remove Dashboard from View");
win.link_hovered();
}
ImGui::PopStyleColor();
Expand Down
5 changes: 3 additions & 2 deletions common/realsense-ui-advanced-mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <librealsense2/rs_advanced_mode.hpp>
#include <type_traits>
#include <rsutils/string/string-utilities.h>
#include <realsense_imgui.h>

#define TEXT_BUFF_SIZE 1024

Expand All @@ -31,7 +32,7 @@ bool* draw_edit_button(const char* id, T val, std::string*& val_str)
}
if (ImGui::IsItemHovered())
{
ImGui::SetTooltip("Enter text-edit mode");
RsImGui::CustomTooltip("Enter text-edit mode");
}
ImGui::PopStyleColor(4);
}
Expand All @@ -48,7 +49,7 @@ bool* draw_edit_button(const char* id, T val, std::string*& val_str)
}
if (ImGui::IsItemHovered())
{
ImGui::SetTooltip("Exit text-edit mode");
RsImGui::CustomTooltip("Exit text-edit mode");
}
ImGui::PopStyleColor(4);
}
Expand Down
Loading

0 comments on commit 5b40a7e

Please sign in to comment.