@@ -146,6 +146,32 @@ void LogPaneSecondView::DrawMenuBar() {
146146 }
147147}
148148
149+ void LogPaneSecondView::goOnNextSelection () {
150+ int32_t max_idx = m_LogDatas.size ();
151+ for (int32_t idx = m_LogListClipper.DisplayStart + 1 ; idx < max_idx; ++idx) {
152+ const auto infos_ptr = m_LogDatas.at (idx).lock ();
153+ if (infos_ptr) {
154+ if (LogEngine::Instance ()->isSignalShown (infos_ptr->category , infos_ptr->name )) {
155+ ImGui::SetScrollY (ImGui::GetScrollY () + ImGui::GetTextLineHeightWithSpacing () * (idx - m_LogListClipper.DisplayStart ));
156+ break ;
157+ }
158+ }
159+ }
160+ }
161+
162+ void LogPaneSecondView::goOnBackSelection () {
163+ int32_t max_idx = m_LogDatas.size ();
164+ for (int32_t idx = m_LogListClipper.DisplayStart - 1 ; idx >= 0 ; --idx) {
165+ const auto infos_ptr = m_LogDatas.at (idx).lock ();
166+ if (infos_ptr) {
167+ if (LogEngine::Instance ()->isSignalShown (infos_ptr->category , infos_ptr->name )) {
168+ ImGui::SetScrollY (ImGui::GetScrollY () + ImGui::GetTextLineHeightWithSpacing () * (idx - m_LogListClipper.DisplayStart ));
169+ break ;
170+ }
171+ }
172+ }
173+ }
174+
149175void LogPaneSecondView::DrawTable () {
150176 ImGuiTableFlags flags = ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_RowBg | ImGuiTableFlags_Hideable | ImGuiTableFlags_ScrollY |
151177 ImGuiTableFlags_NoHostExtendY;
@@ -211,6 +237,16 @@ void LogPaneSecondView::DrawTable() {
211237 color = 0U ;
212238 }
213239
240+ if (m_nextSelectionNeeded) {
241+ m_nextSelectionNeeded = false ;
242+ goOnNextSelection ();
243+ }
244+
245+ if (m_backSelectionNeeded) {
246+ m_backSelectionNeeded = false ;
247+ goOnBackSelection ();
248+ }
249+
214250 if (ImGui::TableNextColumn ()) // time
215251 {
216252 ImGui::Selectable (ez::str::toStr (" %f" , infos_ptr->time_epoch ).c_str (), &selected, ImGuiSelectableFlags_SpanAllColumns);
0 commit comments