From 78a56640c3a1bd0a994cb213e134c43b0fddd853 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 25 Apr 2020 13:14:27 +0200 Subject: [PATCH] Open connection popup when a connection is established. --- server/TracyView.cpp | 9 ++++++++- server/TracyView.hpp | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index d9658209..0375c404 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -128,6 +128,7 @@ View::View( const char* addr, int port, ImFont* fixedWidth, ImFont* smallFont, I : m_worker( addr, port ) , m_staticView( false ) , m_pause( false ) + , m_forceConnectionPopup( true ) , m_frames( nullptr ) , m_messagesScrollBottom( true ) , m_smallFont( smallFont ) @@ -508,8 +509,13 @@ bool View::DrawImpl() if( !m_staticView ) { - if( ImGui::Button( ICON_FA_WIFI ) ) + if( ImGui::Button( ICON_FA_WIFI ) || m_forceConnectionPopup ) { + if( m_forceConnectionPopup ) + { + m_forceConnectionPopup = false; + ImGui::SetNextWindowPos( ImGui::GetCursorPos() ); + } ImGui::OpenPopup( "TracyConnectionPopup" ); } ImGui::SameLine(); @@ -11265,6 +11271,7 @@ void View::DrawStatistics() ImGui::Indent( indentVal ); } const auto file = m_worker.GetString( srcloc.file ); + ImGui::TextDisabled( "%s:%i", file, srcloc.line ); if( ImGui::IsItemClicked( 1 ) ) { diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 51dfc233..a45b4f9e 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -298,6 +298,7 @@ private: std::string m_filename; bool m_staticView; bool m_pause; + bool m_forceConnectionPopup = false; ViewData m_vd;