mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Implement switching between frame sets.
This commit is contained in:
parent
88d9307d7a
commit
acabdf3c2a
@ -419,9 +419,27 @@ bool View::DrawImpl()
|
|||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if( ImGui::Button( "Compare" ) ) m_compare.show = true;
|
if( ImGui::Button( "Compare" ) ) m_compare.show = true;
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
if( ImGui::BeginCombo( "##frameCombo", nullptr, ImGuiComboFlags_NoPreview ) )
|
||||||
|
{
|
||||||
|
auto& frames = m_worker.GetFrames();
|
||||||
|
for( auto& fd : frames )
|
||||||
|
{
|
||||||
|
bool isSelected = m_frames == fd;
|
||||||
|
if( ImGui::Selectable( fd->name == 0 ? "Frames" : m_worker.GetString( fd->name ), isSelected ) )
|
||||||
|
{
|
||||||
|
m_frames = fd;
|
||||||
|
}
|
||||||
|
if( isSelected )
|
||||||
|
{
|
||||||
|
ImGui::SetItemDefaultFocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImGui::EndCombo();
|
||||||
|
}
|
||||||
|
ImGui::SameLine();
|
||||||
if( ImGui::SmallButton( "<" ) ) ZoomToPrevFrame();
|
if( ImGui::SmallButton( "<" ) ) ZoomToPrevFrame();
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::Text( "Frames: %s", RealToString( m_worker.GetFrameCount( *m_frames ), true ) );
|
ImGui::Text( "%s: %s", m_frames->name == 0 ? "Frames" : m_worker.GetString( m_frames->name ), RealToString( m_worker.GetFrameCount( *m_frames ), true ) );
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if( ImGui::SmallButton( ">" ) ) ZoomToNextFrame();
|
if( ImGui::SmallButton( ">" ) ) ZoomToNextFrame();
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
@ -3745,7 +3763,7 @@ void View::DrawOptions()
|
|||||||
for( const auto& fd : m_worker.GetFrames() )
|
for( const auto& fd : m_worker.GetFrames() )
|
||||||
{
|
{
|
||||||
ImGui::PushID( idx++ );
|
ImGui::PushID( idx++ );
|
||||||
ImGui::Checkbox( fd->name == 0 ? "Base frame set" : m_worker.GetString( fd->name ), &Visible( fd ) );
|
ImGui::Checkbox( fd->name == 0 ? "Frames" : m_worker.GetString( fd->name ), &Visible( fd ) );
|
||||||
ImGui::PopID();
|
ImGui::PopID();
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::TextDisabled( "%s frames", RealToString( fd->frames.size(), true ) );
|
ImGui::TextDisabled( "%s frames", RealToString( fd->frames.size(), true ) );
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user