Move the displayed 'fields' details view with the cursor line

pull/1090/head
Florian Münchbach 2 years ago
parent e426a63731
commit 2c3b76c936

@ -546,7 +546,7 @@ field_overlay_source::list_value_for_overlay(const listview_curses& lv,
vis_line_t row,
attr_line_t& value_out)
{
if (y == 0) {
if (y <= 0) {
this->build_field_lines(lv);
return false;
}

@ -217,13 +217,14 @@ listview_curses::do_update()
std::vector<attr_line_t> rows(
std::min((size_t) height, row_count - (int) this->lv_top));
this->lv_source->listview_value_for_rows(*this, row, rows);
vis_line_t selected_in_view = this->get_selection() - this->get_top();
while (y < bottom) {
lr.lr_start = this->lv_left;
lr.lr_end = this->lv_left + wrap_width;
if (this->lv_overlay_source != nullptr
&& this->lv_overlay_source->list_value_for_overlay(
*this,
y - this->lv_y,
y - selected_in_view - this->lv_y,
bottom - this->lv_y,
row,
overlay_line))

@ -552,7 +552,8 @@ protected:
bool lv_word_wrap{false};
bool lv_selectable{true};
vis_line_t lv_selection{0};
vis_line_t lv_displayed_rows{0};
vis_line_t lv_displayed_rows{0}; /*< Number of actually displayed rows,
excluding wrapped and empty lines. */
struct timeval lv_mouse_time {
0, 0

Loading…
Cancel
Save