1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-05 22:53:52 +00:00

Allow performing range copies from one to another.

This commit is contained in:
Bartosz Taudul 2020-08-04 17:02:04 +02:00
parent 85e8a6a81c
commit 68e452802b
2 changed files with 12 additions and 2 deletions

View File

@ -14672,7 +14672,7 @@ void View::DrawRanges()
ImGui::End(); ImGui::End();
} }
void View::DrawRangeEntry( Range& range, const char* label, uint32_t color, const char* popupLabel ) void View::DrawRangeEntry( Range& range, const char* label, uint32_t color, const char* popupLabel, int id )
{ {
SmallColorBox( color ); SmallColorBox( color );
ImGui::SameLine(); ImGui::SameLine();
@ -14716,6 +14716,16 @@ void View::DrawRangeEntry( Range& range, const char* label, uint32_t color, cons
} }
ImGui::EndPopup(); ImGui::EndPopup();
} }
if( id != 0 )
{
ImGui::SameLine();
if( SmallButtonDisablable( ICON_FA_SEARCH " Copy from find zone", m_findZone.range.min == 0 && m_findZone.range.max == 0 ) ) range = m_findZone.range;
}
if( id != 1 )
{
ImGui::SameLine();
if( SmallButtonDisablable( ICON_FA_SORT_AMOUNT_UP " Copy from statistics", m_statRange.min == 0 && m_statRange.max == 0 ) ) range = m_findZone.range;
}
} }
} }

View File

@ -195,7 +195,7 @@ private:
void DrawAnnotationList(); void DrawAnnotationList();
void DrawSampleParents(); void DrawSampleParents();
void DrawRanges(); void DrawRanges();
void DrawRangeEntry( Range& range, const char* label, uint32_t color, const char* popupLabel ); void DrawRangeEntry( Range& range, const char* label, uint32_t color, const char* popupLabel, int id );
void ListMemData( std::vector<const MemEvent*>& vec, std::function<void(const MemEvent*)> DrawAddress, const char* id = nullptr, int64_t startTime = -1 ); void ListMemData( std::vector<const MemEvent*>& vec, std::function<void(const MemEvent*)> DrawAddress, const char* id = nullptr, int64_t startTime = -1 );