forked from enlightenment/terminology
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:
parent
149d23d484
commit
31da027aef
|
@ -237,11 +237,15 @@ miniview_position_offset(Evas_Object *obj, int by, Eina_Bool sanitize)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mv->screen.pos_val += (double) by / (mv->img_h - mv->rows);
|
if (sanitize)
|
||||||
edje_object_part_drag_value_set(mv->base, "miniview_screen",
|
{
|
||||||
0.0, mv->screen.pos_val);
|
mv->screen.pos_val += (double) by / (mv->img_h - mv->rows);
|
||||||
if (mv->screen.pos_val < 0 && sanitize) mv->screen.pos_val = 0;
|
edje_object_part_drag_value_set(mv->base, "miniview_screen",
|
||||||
if (mv->screen.pos_val > 1 && sanitize) mv->screen.pos_val = 1;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
if ((!sd->jump_on_change) && // if NOT scroll to bottom on updates
|
||||||
(sd->scroll > 0))
|
(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
|
// adjust scroll position for added scrollback
|
||||||
sd->scroll -= direction;
|
sd->scroll -= direction;
|
||||||
if (sd->scroll > sd->pty->backscroll_num)
|
if (sd->scroll > sd->pty->backscroll_num)
|
||||||
|
|
Loading…
Reference in New Issue