aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKalle Wallin <kaw@linux.se>2004-06-09 17:03:53 +0000
committerKalle Wallin <kaw@linux.se>2004-06-09 17:03:53 +0000
commitb52e7e0365fe17ccf526f7c355ce6247cf44f919 (patch)
treee4da50a08e2f9773e74217bc841f4cb11cc085af
parent68176d260a785ee664868cbb94478927da7d9741 (diff)
downloadmpd-b52e7e0365fe17ccf526f7c355ce6247cf44f919.tar.gz
mpd-b52e7e0365fe17ccf526f7c355ce6247cf44f919.tar.xz
mpd-b52e7e0365fe17ccf526f7c355ce6247cf44f919.zip
Fixed a small layout bug whith long strings in list_window_paint()
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1418 09075e82-0dd4-0310-85a5-a0d7c8717e4f
-rw-r--r--src/list_window.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/list_window.c b/src/list_window.c
index 6b4a41f0c..588725625 100644
--- a/src/list_window.c
+++ b/src/list_window.c
@@ -1,5 +1,7 @@
/*
- * (c) 2004 by Kalle Wallin (kaw@linux.se)
+ * $Id$
+ *
+ * (c) 2004 by Kalle Wallin <kaw@linux.se>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -166,6 +168,7 @@ list_window_paint(list_window_t *lw,
if( label )
{
int selected = lw->start+i == lw->selected;
+ size_t len = strlen(label);
if( highlight )
colors_use(lw->w, COLOR_LIST_BOLD);
@@ -175,9 +178,9 @@ list_window_paint(list_window_t *lw,
if( selected )
wattron(lw->w, A_REVERSE);
- waddnstr(lw->w, label, lw->cols-1);
- if( fill )
- mvwhline(lw->w, i, strlen(label), ' ', lw->cols-1);
+ waddnstr(lw->w, label, lw->cols);
+ if( fill && len<lw->cols )
+ mvwhline(lw->w, i, len, ' ', lw->cols-len);
if( selected )
wattroff(lw->w, A_REVERSE);