aboutsummaryrefslogtreecommitdiffstats
path: root/src/screen_help.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-17 12:18:00 +0200
committerMax Kellermann <max@duempel.org>2008-09-17 12:18:00 +0200
commitca2b9d1390a56b89336b963113b5763edd70238e (patch)
treefb21cce04bc44a9bcb4a8e06fadd1b02776defc9 /src/screen_help.c
parent104b126c69b89cc4b7caf301fbdbd0b1c9a21bda (diff)
downloadmpd-ca2b9d1390a56b89336b963113b5763edd70238e.tar.gz
mpd-ca2b9d1390a56b89336b963113b5763edd70238e.tar.xz
mpd-ca2b9d1390a56b89336b963113b5763edd70238e.zip
list_window: added list_window_scroll_cmd()
It is similar to list_window_cmd(), but it scrolls the window instead of moving the selection. It is used by the "lyrics" and the "help" screen.
Diffstat (limited to '')
-rw-r--r--src/screen_help.c38
1 files changed, 1 insertions, 37 deletions
diff --git a/src/screen_help.c b/src/screen_help.c
index 7c5134fc6..850608181 100644
--- a/src/screen_help.c
+++ b/src/screen_help.c
@@ -240,44 +240,8 @@ help_update(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c)
static int
help_cmd(screen_t *screen, mpd_unused mpdclient_t *c, command_t cmd)
{
- lw->repaint=1;
- lw->clear=1;
- switch(cmd) {
- case CMD_LIST_NEXT:
- if (lw->start + lw->rows < (unsigned)help_text_rows)
- lw->start++;
+ if (list_window_scroll_cmd(lw, help_text_rows, cmd))
return 1;
- case CMD_LIST_PREVIOUS:
- if (lw->start > 0)
- lw->start--;
- return 1;
- case CMD_LIST_FIRST:
- lw->start = 0;
- return 1;
- case CMD_LIST_LAST:
- if ((unsigned)help_text_rows > lw->rows)
- lw->start = help_text_rows - lw->rows;
- else
- lw->start = 0;
- return 1;
- case CMD_LIST_NEXT_PAGE:
- lw->start = lw->start + lw->rows;
- if (lw->start + lw->rows >= (unsigned)help_text_rows) {
- if ((unsigned)help_text_rows > lw->rows)
- lw->start = help_text_rows - lw->rows;
- else
- lw->start = 0;
- }
- return 1;
- case CMD_LIST_PREVIOUS_PAGE:
- if (lw->start > lw->rows)
- lw->start -= lw->rows;
- else
- lw->start = 0;
- return 1;
- default:
- break;
- }
lw->selected = lw->start+lw->rows;
if (screen_find(screen,