@@ -63,8 +63,6 @@ bool LogPane::DrawPanes(const uint32_t& /*vCurrentFrame*/, bool* vOpened, ImGuiC
63
63
}
64
64
}
65
65
66
- // MainFrame::sAnyWindowsHovered |= ImGui::IsWindowHovered();
67
-
68
66
ImGui::End ();
69
67
}
70
68
return change;
@@ -124,6 +122,16 @@ void LogPane::DrawMenuBar() {
124
122
ImGui::EndMenu ();
125
123
}
126
124
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
+
127
135
if (ProjectFile::Instance ()->m_HideSomeLogValues ) {
128
136
ImGui::Text (" (?)" );
129
137
if (ImGui::IsItemHovered ()) {
@@ -149,6 +157,32 @@ void LogPane::DrawMenuBar() {
149
157
}
150
158
}
151
159
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
+
152
186
void LogPane::DrawTable () {
153
187
ImGuiTableFlags flags = ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_RowBg | ImGuiTableFlags_Hideable | ImGuiTableFlags_ScrollY | ImGuiTableFlags_NoHostExtendY;
154
188
@@ -189,7 +223,7 @@ void LogPane::DrawTable() {
189
223
bool selected = false ;
190
224
m_LogListClipper.Begin ((int )_count_logs, ImGui::GetTextLineHeightWithSpacing ());
191
225
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) {
193
227
if (i < 0 )
194
228
continue ;
195
229
@@ -211,6 +245,16 @@ void LogPane::DrawTable() {
211
245
color = 0U ;
212
246
}
213
247
248
+ if (m_nextSelectionNeeded) {
249
+ m_nextSelectionNeeded = false ;
250
+ goOnNextSelection ();
251
+ }
252
+
253
+ if (m_backSelectionNeeded) {
254
+ m_backSelectionNeeded = false ;
255
+ goOnBackSelection ();
256
+ }
257
+
214
258
if (ImGui::TableNextColumn ()) // time
215
259
{
216
260
ImGui::Selectable (ez::str::toStr (" %f" , infos_ptr->time_epoch ).c_str (), &selected, ImGuiSelectableFlags_SpanAllColumns);
@@ -291,8 +335,9 @@ void LogPane::PrepareLog() {
291
335
}
292
336
293
337
auto selected = LogEngine::Instance ()->isSignalShown (infos_ptr->category , infos_ptr->name );
294
- if (_collapseSelection && !selected)
338
+ if (_collapseSelection && !selected) {
295
339
continue ;
340
+ }
296
341
297
342
if (ProjectFile::Instance ()->m_HideSomeLogValues ) {
298
343
bool found = false ;
0 commit comments