From ade01e98adfbbb0b512884f9217a9cb7a77798e3 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 27 Nov 2019 01:42:44 +0100 Subject: [PATCH] Add time-relative switch to message list in zone info window. --- server/TracyView.cpp | 4 +++- server/TracyView.hpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 5568ae28..fed9c9ab 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -6117,6 +6117,8 @@ void View::DrawZoneInfoWindow() ImGui::TextDisabled( "(%s)", RealToString( dist, true ) ); if( expand ) { + ImGui::SameLine(); + SmallCheckbox( "Time relative to zone start", &m_messageTimeRelativeToZone ); static bool widthSet = false; ImGui::Columns( 2 ); if( !widthSet ) @@ -6134,7 +6136,7 @@ void View::DrawZoneInfoWindow() do { ImGui::PushID( *msgit ); - if( ImGui::Selectable( TimeToString( (*msgit)->time - ev.Start() ), m_msgHighlight == *msgit, ImGuiSelectableFlags_SpanAllColumns ) ) + if( ImGui::Selectable( TimeToString( m_messageTimeRelativeToZone ? (*msgit)->time - ev.Start() : (*msgit)->time ), m_msgHighlight == *msgit, ImGuiSelectableFlags_SpanAllColumns ) ) { CenterAtTime( (*msgit)->time ); } diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 8e59e3e0..3aadc72c 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -346,6 +346,7 @@ private: bool m_groupChildrenLocations = false; bool m_allocTimeRelativeToZone = true; bool m_ctxSwitchTimeRelativeToZone = true; + bool m_messageTimeRelativeToZone = true; ShortcutAction m_shortcut = ShortcutAction::None; Namespace m_namespace = Namespace::Short;