From 6b9ccb307732e486bd95aa029fcea1998168de02 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 1 Jan 2022 16:10:49 +0100 Subject: [PATCH] Tooltip shortcut function. --- server/TracyImGui.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/TracyImGui.hpp b/server/TracyImGui.hpp index 4c7c4f1e..092da73e 100644 --- a/server/TracyImGui.hpp +++ b/server/TracyImGui.hpp @@ -254,6 +254,14 @@ static const ImVec4 SyntaxColorsDimmed[] = { draw->AddPolyline( data, 3, col, 0, thickness ); } +[[maybe_unused]] static tracy_force_inline void TooltipIfHovered( const char* text ) +{ + if( !ImGui::IsItemHovered() ) return; + ImGui::BeginTooltip(); + ImGui::TextUnformatted( text ); + ImGui::EndTooltip(); +} + } #endif