Add copy from section to compare range limits.

This commit is contained in:
Bartosz Taudul
2026-07-04 22:29:14 +02:00
parent 71d88fd198
commit 18cfcd7e90
@@ -383,6 +383,29 @@ void View::DrawCompare()
}
ImGui::EndMenu();
}
auto& sections = m_worker.GetSections();
if( sections.empty() )
{
TextDisabledUnformatted( "Sections" );
}
else if( ImGui::BeginMenu( "Sections" ) )
{
int id = 0;
for( auto& v : sections )
{
ImGui::PushID( id++ );
if( ImGui::MenuItem( m_worker.GetString( v.text ) ) )
{
m_compare.range[0].min = v.start.Val();
m_compare.range[0].max = v.end.Val();
m_compare.ResetSelection();
}
ImGui::PopID();
ImGui::SameLine();
ImGui::TextDisabled( "%s - %s (%s)", TimeToStringExact( v.start.Val() ), TimeToStringExact( v.end.Val() ), TimeToString( v.end.Val() - v.start.Val() ) );
}
ImGui::EndMenu();
}
ImGui::EndPopup();
}
if( ImGui::BeginPopup( "compareCopyFromExt" ) )
@@ -412,6 +435,29 @@ void View::DrawCompare()
}
ImGui::EndMenu();
}
auto& sections = m_compare.second->GetSections();
if( sections.empty() )
{
TextDisabledUnformatted( "Sections" );
}
else if( ImGui::BeginMenu( "Sections" ) )
{
int id = 0;
for( auto& v : sections )
{
ImGui::PushID( id++ );
if( ImGui::MenuItem( m_compare.second->GetString( v.text ) ) )
{
m_compare.range[1].min = v.start.Val();
m_compare.range[1].max = v.end.Val();
m_compare.ResetSelection();
}
ImGui::PopID();
ImGui::SameLine();
ImGui::TextDisabled( "%s - %s (%s)", TimeToStringExact( v.start.Val() ), TimeToStringExact( v.end.Val() ), TimeToString( v.end.Val() - v.start.Val() ) );
}
ImGui::EndMenu();
}
ImGui::EndPopup();
}
ImGui::Unindent();