diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 168ad5f8..5f4f7ad4 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -557,6 +557,34 @@ bool View::DrawImpl() ToggleButton( "Info", m_showInfo ); #endif ImGui::SameLine(); +#ifdef TRACY_EXTENDED_FONT + if( ImGui::Button( ICON_FA_TOOLS ) ) ImGui::OpenPopup( "ToolsPopup" ); +#else + if( ImGui::Button( "Tools" ) ) ImGui::OpenPopup( "ToolsPopup" ); +#endif + if( ImGui::BeginPopup( "ToolsPopup" ) ) + { + const auto ficnt = m_worker.GetFrameImageCount(); +#ifdef TRACY_EXTENDED_FONT + if( ButtonDisablable( ICON_FA_PLAY " Playback", ficnt == 0 ) ) +#else + if( ButtonDisablable( "Playback", , ficnt == 0) ) +#endif + { + m_showPlayback = true; + } + const auto& ctd = m_worker.GetCpuThreadData(); +#ifdef TRACY_EXTENDED_FONT + if( ButtonDisablable( ICON_FA_SLIDERS_H " CPU data", ctd.empty() ) ) +#else + if( ButtonDisablable( "CPU data", ctd.empty() ) ) +#endif + { + m_showCpuDataWindow = true; + } + ImGui::EndPopup(); + } + ImGui::SameLine(); #ifdef TRACY_EXTENDED_FONT if( ImGui::SmallButton( " " ICON_FA_CARET_LEFT " " ) ) ZoomToPrevFrame(); #else @@ -10894,33 +10922,6 @@ void View::DrawInfo() ImGui::TreePop(); } - if( ficnt != 0 ) - { - ImGui::Separator(); -#ifdef TRACY_EXTENDED_FONT - if( ImGui::Button( ICON_FA_PLAY " Playback" ) ) -#else - if( ImGui::Button( "Playback" ) ) -#endif - { - m_showPlayback = true; - } - } - - const auto& ctd = m_worker.GetCpuThreadData(); - if( !ctd.empty() ) - { - if( ficnt != 0 ) ImGui::SameLine(); -#ifdef TRACY_EXTENDED_FONT - if( ImGui::Button( ICON_FA_SLIDERS_H " CPU data" ) ) -#else - if( ImGui::Button( "CPU data" ) ) -#endif - { - m_showCpuDataWindow = true; - } - } - ImGui::Separator(); TextFocused( "PID:", RealToString( m_worker.GetPid(), true ) ); TextFocused( "Host info:", m_worker.GetHostInfo().c_str() );