miniview: scroll position indicator when jump on change isn't checked.

Summary:
Fix indicators position when your are at some place in scrollback
and terminal outputs some new lines (say from a running command). It
now scrolls to where it should be.

Reviewers: billiob

Differential Revision: https://phab.enlightenment.org/D1335
This commit is contained in:
godfath3r 2014-08-16 18:45:14 +02:00 committed by Boris Faure
parent 149d23d484
commit 31da027aef
2 changed files with 11 additions and 5 deletions

View File

@ -237,11 +237,15 @@ miniview_position_offset(Evas_Object *obj, int by, Eina_Bool sanitize)
}
else
{
mv->screen.pos_val += (double) by / (mv->img_h - mv->rows);
edje_object_part_drag_value_set(mv->base, "miniview_screen",
0.0, mv->screen.pos_val);
if (mv->screen.pos_val < 0 && sanitize) mv->screen.pos_val = 0;
if (mv->screen.pos_val > 1 && sanitize) mv->screen.pos_val = 1;
if (sanitize)
{
mv->screen.pos_val += (double) by / (mv->img_h - mv->rows);
edje_object_part_drag_value_set(mv->base, "miniview_screen",
0.0, mv->screen.pos_val);
if (mv->screen.pos_val < 0) mv->screen.pos_val = 0;
if (mv->screen.pos_val > 1) mv->screen.pos_val = 1;
}
}
}

View File

@ -4166,6 +4166,8 @@ termio_scroll(Evas_Object *obj, int direction, int start_y, int end_y)
if ((!sd->jump_on_change) && // if NOT scroll to bottom on updates
(sd->scroll > 0))
{
Evas_Object *mv = term_miniview_get(sd->term);
if (mv) miniview_position_offset(mv, direction, EINA_FALSE);
// adjust scroll position for added scrollback
sd->scroll -= direction;
if (sd->scroll > sd->pty->backscroll_num)