From: Kalle Wallin Date: Wed, 9 Jun 2004 17:03:53 +0000 (+0000) Subject: Fixed a small layout bug whith long strings in list_window_paint() X-Git-Tag: v0.12_alpha1~537 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b52e7e0365fe17ccf526f7c355ce6247cf44f919;p=ncmpc.git 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 --- diff --git a/src/list_window.c b/src/list_window.c index 6b4a41f..5887256 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 * * 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 && lencols ) + mvwhline(lw->w, i, len, ' ', lw->cols-len); if( selected ) wattroff(lw->w, A_REVERSE);