From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id E0AF9138805 for ; Sat, 2 Feb 2013 20:49:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6F07DE04CB; Sat, 2 Feb 2013 20:49:28 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 10B64E04CB for ; Sat, 2 Feb 2013 20:49:27 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 174F033BEB1 for ; Sat, 2 Feb 2013 20:49:27 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 77276E4073 for ; Sat, 2 Feb 2013 20:49:25 +0000 (UTC) From: "Sven Eden" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sven Eden" Message-ID: <1359838195.82e96916d6a3e684110963ca2ead9a96eef58cbf.yamakuzure@gentoo> Subject: [gentoo-commits] proj/ufed:master commit in: / X-VCS-Repository: proj/ufed X-VCS-Files: ufed-curses-checklist.c ufed-curses.c X-VCS-Directories: / X-VCS-Committer: yamakuzure X-VCS-Committer-Name: Sven Eden X-VCS-Revision: 82e96916d6a3e684110963ca2ead9a96eef58cbf X-VCS-Branch: master Date: Sat, 2 Feb 2013 20:49:25 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 0fe214b2-f498-4b51-b8fa-e6afbf74694c X-Archives-Hash: 8f7a16ac6d7d8c65ec18354350b46ac3 commit: 82e96916d6a3e684110963ca2ead9a96eef58cbf Author: Sven Eden gmx de> AuthorDate: Sat Feb 2 20:49:55 2013 +0000 Commit: Sven Eden gmx de> CommitDate: Sat Feb 2 20:49:55 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/ufed.git;a=commit;h=82e96916 Fixed a bug that could cause a found flag to be below the display if a displayed flag above it has one or more filtered description lines. --- ufed-curses-checklist.c | 21 +++++++++++---------- ufed-curses.c | 2 ++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ufed-curses-checklist.c b/ufed-curses-checklist.c index f8a5ec4..ac6c60f 100644 --- a/ufed-curses-checklist.c +++ b/ufed-curses-checklist.c @@ -221,9 +221,12 @@ static int drawflag(sFlag* flag, bool highlight) */ if (line < 0) { if (-line < getFlagHeight(flag)) { - idx = -line; - line = 0; - usedY = idx; + while (line < 0) { + if (isDescLegal(flag, idx++)) { + ++line; + ++usedY; + } + } } else // Otherwise this item is out of the display area return 0; @@ -487,17 +490,15 @@ static int callback(sFlag** curr, int key) wattrset(wInp, COLOR_PAIR(4) | A_BOLD | A_REVERSE); mvwaddstr(wInp, 0, 0, fayt); wmove(wInp, 0, fLen - 1); - wnoutrefresh(wLst); wrefresh(wInp); } else { - drawflag(*curr, FALSE); - *curr = flag; - scrollcurrent(); - drawflag(*curr, TRUE); wattrset(wInp, COLOR_PAIR(5) | A_BOLD); mvwaddstr(wInp, 0, 0, fayt); - wnoutrefresh(wLst); - wrefresh(wInp); + wnoutrefresh(wInp); + drawflag(*curr, FALSE); + *curr = flag; + if (!scrollcurrent()) + drawflag(*curr, TRUE); } } } diff --git a/ufed-curses.c b/ufed-curses.c index 0c3fd56..cb94363 100644 --- a/ufed-curses.c +++ b/ufed-curses.c @@ -417,12 +417,14 @@ bool scrollcurrent() { int flHeight = getFlagHeight(currentflag); int btLine = lsLine + flHeight; int wdHeight = wHeight(List); + if(lsLine < topline) topline = max(lsLine, btLine - wdHeight); else if( btLine > (topline + wdHeight)) topline = min(btLine - wdHeight, lsLine); else return false; + drawFlags(); drawScrollbar(); return true;