aboutsummaryrefslogtreecommitdiffstats
path: root/src/screen_lyrics.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-17 12:20:42 +0200
committerMax Kellermann <max@duempel.org>2008-09-17 12:20:42 +0200
commitfd7abf4f81a69014b0e1e967c7965996a11295b0 (patch)
tree539a4a746587dd3090642657c9304492a0f6017f /src/screen_lyrics.c
parentca2b9d1390a56b89336b963113b5763edd70238e (diff)
downloadmpd-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.c10
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;
}