Skip to content

Search Highlight #664

Open
Sajeeth-Wimalasuriyan wants to merge 1 commit intodevfrom
swimalas/Search_Highlight_v2
Open

Search Highlight #664
Sajeeth-Wimalasuriyan wants to merge 1 commit intodevfrom
swimalas/Search_Highlight_v2

Conversation

@Sajeeth-Wimalasuriyan
Copy link
Contributor

No description provided.

Copy link
Collaborator

@tomk-amd tomk-amd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice if this also highlighted an event the is "jumped to" using the context menu in the event table. But I'm not sure what would be a consitent way of clearing the highlight in scenario should be?

Comment on lines +703 to +712
ImVec2 container_pos = ImGui::GetWindowPos();
double normalized_start =
container_pos.x + m_tpt->RawTimeToPixel(item.event.m_start_ts);

double normalized_duration =
std::max(item.event.m_duration * m_tpt->GetPixelsPerNs(), 1.0);

ImVec2 start_position;
float rounding = 2.0f;
start_position = ImVec2(static_cast<float>(normalized_start),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract rendering logic into a RenderBoxFrame(frame_color) method and use for both selection and highlight

Comment on lines +214 to +216
m_search_highlighted_event_ids.insert(event_id);
SendEventSelectionChanged(event_id, track_id, true);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Highlight needs it own event(s). It should not piggy back off of event selection events. As is highlighting an event will clear / alter selection

{
item.selected = m_timeline_selection->EventSelected(item.event.m_id.uuid);
item.search_highlighted = m_timeline_selection->EventSearchHighlighted(item.event.m_id.uuid);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Search highlight state should be handled in a dedicated event

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants