Move locks, zones, etc in options menu out of view.

This commit is contained in:
Bartosz Taudul 2018-03-15 23:33:05 +01:00
parent 81ff554c7d
commit 79418d0c57

View File

@ -2585,24 +2585,48 @@ void View::DrawOptions()
{
const auto tw = ImGui::GetFontSize();
ImGui::Begin( "Options", &m_showOptions, ImGuiWindowFlags_AlwaysAutoResize );
auto sz = m_worker.GetGpuData().size();
if( sz > 0 )
{
ImGui::Checkbox( "Draw GPU zones", &m_drawGpuZones );
ImGui::Indent( tw );
for( size_t i=0; i<m_worker.GetGpuData().size(); i++ )
const auto expand = ImGui::TreeNode( "GPU zones" );
ImGui::SameLine();
ImGui::TextDisabled( "(%zu)", sz );
if( expand )
{
for( size_t i=0; i<sz; i++ )
{
char buf[1024];
sprintf( buf, "GPU context %zu", i );
ImGui::Checkbox( buf, &Visible( m_worker.GetGpuData()[i] ) );
}
ImGui::Unindent( tw );
ImGui::TreePop();
}
}
ImGui::Checkbox( "Draw CPU zones", &m_drawZones );
int ns = (int)m_namespace;
ImGui::Combo( "Namespaces", &ns, "Full\0Shortened\0None\0" );
m_namespace = (Namespace)ns;
if( !m_worker.GetLockMap().empty() )
{
ImGui::Separator();
ImGui::Checkbox( "Draw locks", &m_drawLocks );
ImGui::SameLine();
ImGui::Checkbox( "Only contended", &m_onlyContendedLocks );
ImGui::Indent( tw );
const auto expand = ImGui::TreeNode( "Locks" );
ImGui::SameLine();
ImGui::TextDisabled( "(%zu)", m_worker.GetLockMap().size() );
if( ImGui::IsItemHovered() )
{
ImGui::BeginTooltip();
ImGui::Text( "Locks with no recorded events are counted, but not listed." );
ImGui::EndTooltip();
}
if( expand )
{
for( const auto& l : m_worker.GetLockMap() )
{
if( l.second.valid )
@ -2612,18 +2636,33 @@ void View::DrawOptions()
ImGui::Checkbox( buf, &Visible( &l.second ) );
}
}
ImGui::Unindent( tw );
ImGui::TreePop();
}
}
if( !m_worker.GetPlots().empty() )
{
ImGui::Separator();
ImGui::Checkbox( "Draw plots", &m_drawPlots );
ImGui::Indent( tw );
const auto expand = ImGui::TreeNode( "Plots" );
ImGui::SameLine();
ImGui::TextDisabled( "(%zu)", m_worker.GetPlots().size() );
if( expand )
{
for( const auto& p : m_worker.GetPlots() )
{
ImGui::Checkbox( m_worker.GetString( p->name ), &Visible( p ) );
}
ImGui::Unindent( tw );
ImGui::TreePop();
}
}
ImGui::Separator();
ImGui::Text( "Visible threads:" );
ImGui::Indent( tw );
const auto expand = ImGui::TreeNode( "Visible threads:" );
ImGui::SameLine();
ImGui::TextDisabled( "(%zu)", m_worker.GetThreadData().size() );
if( expand )
{
int idx = 0;
for( const auto& t : m_worker.GetThreadData() )
{
@ -2631,7 +2670,8 @@ void View::DrawOptions()
ImGui::Checkbox( m_worker.GetThreadString( t->id ), &Visible( t ) );
ImGui::PopID();
}
ImGui::Unindent( tw );
ImGui::TreePop();
}
ImGui::End();
}