From 384646b03b8724c23ce82389350418b83b2acbfc Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 4 Oct 2024 22:47:25 +0200 Subject: [PATCH] Disable wrapping of message lines in zone info window. This unifies the behavior with message list in messages window. --- profiler/src/profiler/TracyView_ZoneInfo.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/profiler/src/profiler/TracyView_ZoneInfo.cpp b/profiler/src/profiler/TracyView_ZoneInfo.cpp index c5b56790..3494ada7 100644 --- a/profiler/src/profiler/TracyView_ZoneInfo.cpp +++ b/profiler/src/profiler/TracyView_ZoneInfo.cpp @@ -971,7 +971,19 @@ void View::DrawZoneInfoWindow() ImGui::PopID(); ImGui::TableNextColumn(); ImGui::PushStyleColor( ImGuiCol_Text, (*msgit)->color ); - ImGui::TextWrapped( "%s", m_worker.GetString( (*msgit)->ref ) ); + const auto text = m_worker.GetString( (*msgit)->ref ); + auto tend = text; + while( *tend != '\0' && *tend != '\n' ) tend++; + const auto cw = ImGui::GetContentRegionAvail().x; + const auto tw = ImGui::CalcTextSize( text, tend ).x; + ImGui::TextUnformatted( text, tend ); + if( tw > cw && ImGui::IsItemHovered() ) + { + ImGui::SetNextWindowSize( ImVec2( 1000 * GetScale(), 0 ) ); + ImGui::BeginTooltip(); + ImGui::TextWrapped( "%s", text ); + ImGui::EndTooltip(); + } ImGui::PopStyleColor(); } while( ++msgit != msgend );