From 576994de00fd61b4ce521360cfdb076e9a051ee2 Mon Sep 17 00:00:00 2001 From: Lars Henriksen Date: Sat, 29 Dec 2018 22:32:59 +0100 Subject: Improve scroll window pad A scroll window consists of a pad to write on, and a window through which to view the pad, the viewport. The pad may change in size when new contents are loaded into the scroll window. If so, the pad size is set with wins_scrollwin_set_linecount(). But the offset into the pad (the top line to be displayed in the viewport) is not adjusted, although it may not be appropriate for the new pad size. The same is the case when a scroll window is resized and the viewport changes size. This is probably the cause of the problem solved by commit 0b46ad4, Avoid blank space after the last list box item, and the fix has been removed. The wins_scrollwin_set_linecount() has been renamed wins_scrollwin_set_pad() and sets size as well as offset. The offset is only changed if necessary. Signed-off-by: Lars Henriksen Signed-off-by: Lukas Fleischer --- src/calcurse.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/calcurse.h') diff --git a/src/calcurse.h b/src/calcurse.h index afa9046..c568e89 100644 --- a/src/calcurse.h +++ b/src/calcurse.h @@ -1265,15 +1265,13 @@ void wins_slctd_next(void); void wins_init(void); void wins_scrollwin_init(struct scrollwin *, int, int, int, int, const char *); void wins_scrollwin_resize(struct scrollwin *, int, int, int, int); -void wins_scrollwin_set_linecount(struct scrollwin *, unsigned); +void wins_scrollwin_set_pad(struct scrollwin *, unsigned); void wins_scrollwin_delete(struct scrollwin *); void wins_scrollwin_draw_deco(struct scrollwin *, int); void wins_scrollwin_display(struct scrollwin *, int); void wins_scrollwin_up(struct scrollwin *, int); void wins_scrollwin_down(struct scrollwin *, int); -int wins_scrollwin_is_visible(struct scrollwin *, unsigned); void wins_scrollwin_ensure_visible(struct scrollwin *, unsigned); -void wins_scrollwin_set_lower(struct scrollwin *, unsigned); void wins_resize(void); void wins_resize_panels(void); void wins_show(WINDOW *, const char *); -- cgit v1.2.3