seporaitis / lhl

Linux Ham Log - an attempt to write modern terminal linux ham radio logging application from scratch
0 stars 0 forks source link

Use ncurses pad to enable qsolist scrolling #26

Closed seporaitis closed 5 years ago

seporaitis commented 5 years ago

Description

Part of #1. Allow scroll up and down of the qso list.

Motivation and Context

This is required to have more than a couple of tens of qsos and be able to scroll back and forth with them.

How Has This Been Tested?

Added about 60 qsos and scrolled up and down.

Screenshots (if appropriate):

asciicast

Types of changes

Checklist

seporaitis commented 5 years ago

The scrolling here is a bit broken at the moment - the bottom line gets repeated when scrolling up.

seporaitis commented 5 years ago

The scrolling (up/down) now works. Problem was due to pad being too small - it should hold up to 1024 lines now. Enough for time being.

However, the qso list doesn't follow most recent item (e.g. like it would with scrollok(co->pad, TRUE)). It needs to update co->cursor when co->numitems is larger than the height of the visible part of co->pad. Which brings me to a peeve...

It is quite annoying that LINES - foo + bar is crumbed/duplicated in a couple of places already. It's aleviated somewhat, because it's in a single file, but still. Potentially easiest way to solve this is to just make a macro and use it around.