diff options
author | Max Kellermann <max@duempel.org> | 2008-09-17 12:20:42 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-17 12:20:42 +0200 |
commit | fd7abf4f81a69014b0e1e967c7965996a11295b0 (patch) | |
tree | 539a4a746587dd3090642657c9304492a0f6017f /src/screen_lyrics.c | |
parent | ca2b9d1390a56b89336b963113b5763edd70238e (diff) | |
download | mpd-fd7abf4f81a69014b0e1e967c7965996a11295b0.tar.gz mpd-fd7abf4f81a69014b0e1e967c7965996a11295b0.tar.xz mpd-fd7abf4f81a69014b0e1e967c7965996a11295b0.zip |
list_window: added list_window_center()
Merge code which used to be duplicated in the screens "play", "help",
"lyrics".
Diffstat (limited to 'src/screen_lyrics.c')
-rw-r--r-- | src/screen_lyrics.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c index 5356548c9..6853fecd7 100644 --- a/src/screen_lyrics.c +++ b/src/screen_lyrics.c @@ -292,8 +292,6 @@ lyrics_cmd(screen_t *screen, mpdclient_t *c, command_t cmd) if (list_window_scroll_cmd(lw, current.lines->len, cmd)) return 1; - lw->repaint=1; - switch(cmd) { case CMD_SELECT: /* XXX */ @@ -329,13 +327,7 @@ lyrics_cmd(screen_t *screen, mpdclient_t *c, command_t cmd) lw, lyrics_text_rows, cmd, list_callback, NULL)) { /* center the row */ - lw->start = lw->selected - (lw->rows / 2); - if (lw->start + lw->rows > (unsigned)lyrics_text_rows) { - if (lw->rows < (unsigned)lyrics_text_rows) - lw->start = lyrics_text_rows - lw->rows; - else - lw->start = 0; - } + list_window_center(lw, current.lines->len, lw->selected); return 1; } |