@@ -63,8 +63,6 @@ bool LogPane::DrawPanes(const uint32_t& /*vCurrentFrame*/, bool* vOpened, ImGuiC
6363 }
6464 }
6565
66- // MainFrame::sAnyWindowsHovered |= ImGui::IsWindowHovered();
67-
6866 ImGui::End ();
6967 }
7068 return change;
@@ -124,6 +122,16 @@ void LogPane::DrawMenuBar() {
124122 ImGui::EndMenu ();
125123 }
126124
125+ if (!ProjectFile::Instance ()->m_CollapseLogSelection ) {
126+ if (ImGui::MenuItem (" <<" )) {
127+ m_backSelectionNeeded = true ;
128+ }
129+
130+ if (ImGui::MenuItem (" >>" )) {
131+ m_nextSelectionNeeded = true ;
132+ }
133+ }
134+
127135 if (ProjectFile::Instance ()->m_HideSomeLogValues ) {
128136 ImGui::Text (" (?)" );
129137 if (ImGui::IsItemHovered ()) {
@@ -149,6 +157,32 @@ void LogPane::DrawMenuBar() {
149157 }
150158}
151159
160+ void LogPane::goOnNextSelection () {
161+ int32_t max_idx = m_LogDatas.size ();
162+ for (int32_t idx = m_LogListClipper.DisplayStart + 1 ; idx < max_idx; ++idx) {
163+ const auto infos_ptr = m_LogDatas.at (idx).lock ();
164+ if (infos_ptr) {
165+ if (LogEngine::Instance ()->isSignalShown (infos_ptr->category , infos_ptr->name )) {
166+ ImGui::SetScrollY (ImGui::GetScrollY () + ImGui::GetTextLineHeightWithSpacing () * (idx - m_LogListClipper.DisplayStart ));
167+ break ;
168+ }
169+ }
170+ }
171+ }
172+
173+ void LogPane::goOnBackSelection () {
174+ int32_t max_idx = m_LogDatas.size ();
175+ for (int32_t idx = m_LogListClipper.DisplayStart - 1 ; idx >= 0 ; --idx) {
176+ const auto infos_ptr = m_LogDatas.at (idx).lock ();
177+ if (infos_ptr) {
178+ if (LogEngine::Instance ()->isSignalShown (infos_ptr->category , infos_ptr->name )) {
179+ ImGui::SetScrollY (ImGui::GetScrollY () + ImGui::GetTextLineHeightWithSpacing () * (idx - m_LogListClipper.DisplayStart ));
180+ break ;
181+ }
182+ }
183+ }
184+ }
185+
152186void LogPane::DrawTable () {
153187 ImGuiTableFlags flags = ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_RowBg | ImGuiTableFlags_Hideable | ImGuiTableFlags_ScrollY | ImGuiTableFlags_NoHostExtendY;
154188
@@ -189,7 +223,7 @@ void LogPane::DrawTable() {
189223 bool selected = false ;
190224 m_LogListClipper.Begin ((int )_count_logs, ImGui::GetTextLineHeightWithSpacing ());
191225 while (m_LogListClipper.Step ()) {
192- for (int i = m_LogListClipper.DisplayStart ; i < m_LogListClipper.DisplayEnd ; ++i) {
226+ for (int32_t i = m_LogListClipper.DisplayStart ; i < m_LogListClipper.DisplayEnd ; ++i) {
193227 if (i < 0 )
194228 continue ;
195229
@@ -211,6 +245,16 @@ void LogPane::DrawTable() {
211245 color = 0U ;
212246 }
213247
248+ if (m_nextSelectionNeeded) {
249+ m_nextSelectionNeeded = false ;
250+ goOnNextSelection ();
251+ }
252+
253+ if (m_backSelectionNeeded) {
254+ m_backSelectionNeeded = false ;
255+ goOnBackSelection ();
256+ }
257+
214258 if (ImGui::TableNextColumn ()) // time
215259 {
216260 ImGui::Selectable (ez::str::toStr (" %f" , infos_ptr->time_epoch ).c_str (), &selected, ImGuiSelectableFlags_SpanAllColumns);
@@ -291,8 +335,9 @@ void LogPane::PrepareLog() {
291335 }
292336
293337 auto selected = LogEngine::Instance ()->isSignalShown (infos_ptr->category , infos_ptr->name );
294- if (_collapseSelection && !selected)
338+ if (_collapseSelection && !selected) {
295339 continue ;
340+ }
296341
297342 if (ProjectFile::Instance ()->m_HideSomeLogValues ) {
298343 bool found = false ;
0 commit comments