aboutsummaryrefslogtreecommitdiffstats
path: root/src/screen_help.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_help.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 '')
-rw-r--r--src/screen_help.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/screen_help.c b/src/screen_help.c
index 850608181..363b440cf 100644
--- a/src/screen_help.c
+++ b/src/screen_help.c
@@ -248,16 +248,7 @@ help_cmd(screen_t *screen, mpd_unused mpdclient_t *c, command_t cmd)
lw, help_text_rows,
cmd, list_callback, NULL)) {
/* center the row */
- if (lw->selected > lw->rows / 2)
- lw->start = lw->selected - lw->rows / 2;
- else
- lw->start = 0;
- if (lw->start + lw->rows > (unsigned)help_text_rows) {
- if (lw->rows < (unsigned)help_text_rows)
- lw->start = help_text_rows - lw->rows;
- else
- lw->start = 0;
- }
+ list_window_center(lw, help_text_rows, lw->selected);
return 1;
}