Keep one profiler window size for all captures.

This commit is contained in:
Bartosz Taudul 2018-07-10 20:47:09 +02:00
parent 27a1eb94fe
commit 045f792e84
2 changed files with 8 additions and 2 deletions

2
NEWS
View File

@ -11,6 +11,8 @@ v0.4 (xxxx-xx-xx)
- Added trace update utility, which will convert files saved in previous - Added trace update utility, which will convert files saved in previous
versions of tracy to be up-to-date. versions of tracy to be up-to-date.
- Fix regression causing varying size of profiler window for different
captures.
v0.3.3 (2018-07-03) v0.3.3 (2018-07-03)
------------------- -------------------

View File

@ -333,7 +333,9 @@ bool View::DrawImpl()
{ {
if( !m_worker.HasData() ) if( !m_worker.HasData() )
{ {
ImGui::Begin( m_worker.GetAddr().c_str(), nullptr, ImGuiWindowFlags_AlwaysAutoResize ); char tmp[2048];
sprintf( tmp, "%s###Connection", m_worker.GetAddr().c_str() );
ImGui::Begin( tmp, nullptr, ImGuiWindowFlags_AlwaysAutoResize );
ImGui::Text( "Waiting for connection..." ); ImGui::Text( "Waiting for connection..." );
ImGui::End(); ImGui::End();
return true; return true;
@ -359,7 +361,9 @@ bool View::DrawImpl()
} }
std::lock_guard lock( m_worker.GetDataLock() ); std::lock_guard lock( m_worker.GetDataLock() );
ImGui::Begin( m_worker.GetCaptureName().c_str(), keepOpenPtr, ImVec2( 1550, 800 ), -1, ImGuiWindowFlags_NoScrollbar ); char tmp[2048];
sprintf( tmp, "%s###Profiler", m_worker.GetCaptureName().c_str() );
ImGui::Begin( tmp, keepOpenPtr, ImVec2( 1550, 800 ), -1, ImGuiWindowFlags_NoScrollbar );
if( !m_worker.IsDataStatic() ) if( !m_worker.IsDataStatic() )
{ {
if( ImGui::Button( m_pause ? MainWindowButtons[0] : MainWindowButtons[1], ImVec2( bw, 0 ) ) ) m_pause = !m_pause; if( ImGui::Button( m_pause ? MainWindowButtons[0] : MainWindowButtons[1], ImVec2( bw, 0 ) ) ) m_pause = !m_pause;