[filter] fix a case where top time was not maintained when a filter was applied

This commit is contained in:
Tim Stack 2022-08-11 21:03:45 -07:00
parent 270d44c6b4
commit c824b64840

View File

@ -242,15 +242,14 @@ textview_curses::reload_data()
if (this->tc_sub_source != nullptr) {
this->tc_sub_source->text_update_marks(this->tc_bookmarks);
}
listview_curses::reload_data();
if (this->tc_sub_source != nullptr) {
auto ttt = dynamic_cast<text_time_translator*>(this->tc_sub_source);
auto* ttt = dynamic_cast<text_time_translator*>(this->tc_sub_source);
if (ttt != nullptr) {
ttt->data_reloaded(this);
}
}
listview_curses::reload_data();
}
void
@ -822,6 +821,13 @@ text_time_translator::data_reloaded(textview_curses* tc)
if (tc->get_inner_height() == 0) {
return;
}
if (tc->get_top() > tc->get_inner_height()) {
if (this->ttt_top_time.tv_sec != 0) {
this->row_for_time(this->ttt_top_time) |
[tc](auto new_top) { tc->set_top(new_top); };
}
return;
}
this->time_for_row(tc->get_top()) | [this, tc](auto top_time) {
if (top_time != this->ttt_top_time) {
if (this->ttt_top_time.tv_sec != 0) {