From 9b13b8e1c63bd52a02b1dcee9c8b925b3e4df2b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Sun, 24 Dec 2017 18:54:05 +0100 Subject: [PATCH] Profiler - Fixed checkboxes --- ui-profiling.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ui-profiling.cc b/ui-profiling.cc index 5c4b67c..a937bcc 100644 --- a/ui-profiling.cc +++ b/ui-profiling.cc @@ -148,7 +148,7 @@ void T_Profiler::makeUI( ) ImGui::SetNextWindowPos( ImVec2( 0 , dspSize.y * .66f ) , ImGuiSetCond_Appearing ); ImGui::Begin( "Profiler" , &uiEnabled_ , ImGuiWindowFlags_NoCollapse ); - ImGui::BeginChild( "left" , ImVec2( 180 , 0 ) , true ); + ImGui::BeginChild( "left" , ImVec2( 240 , 0 ) , true ); float angle( 0 ); displayed_.resize( n , true ); for ( auto i = 0u ; i < n ; i ++ ) { @@ -159,14 +159,13 @@ void T_Profiler::makeUI( ) ImGui::PushStyleColor( ImGuiCol_Text , color ); ebcl::T_StringBuilder sb; - char tms[ 12 ]; - snprintf( tms , 12 , "%.1f" , secDurations_[ i ] ); - sb << sections_[ i ] << " (" << tms << "ms)" << '\0'; + sb << sections_[ i ] << '\0'; ImGui::Checkbox( sb.data( ) , &displayed_[ i ] ); ImGui::PopStyleColor( ); if ( ImGui::IsItemHovered( ) ) { ImGui::BeginTooltip( ); + char tms[ 12 ]; snprintf( tms , 12 , "%.3f" , secDurations_[ i ] ); sb.clear( ) << sections_[ i ] << '\0'; ImGui::PushStyleColor( ImGuiCol_Text , color ); @@ -182,6 +181,11 @@ void T_Profiler::makeUI( ) ImGui::EndTooltip( ); } + + ImGui::PushStyleColor( ImGuiCol_Text , color ); + ImGui::SameLine( 180 ); + ImGui::Text( "%.3fms" , secDurations_[ i ] ); + ImGui::PopStyleColor( ); } ImGui::EndChild( ); ImGui::SameLine( );