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 8B560138620 for ; Wed, 23 Jan 2013 12:05:36 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C42E2E0653; Wed, 23 Jan 2013 12:05:32 +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 17D7FE0655 for ; Wed, 23 Jan 2013 12:05:31 +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 2409233DB54 for ; Wed, 23 Jan 2013 12:05:31 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 7EF67E4098 for ; Wed, 23 Jan 2013 12:05:28 +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: <1358942682.56dd9c3f8f8e5f003ad1fa73f7015e03c628fd01.yamakuzure@gentoo> Subject: [gentoo-commits] proj/ufed:master commit in: / X-VCS-Repository: proj/ufed X-VCS-Files: ufed-curses-checklist.c X-VCS-Directories: / X-VCS-Committer: yamakuzure X-VCS-Committer-Name: Sven Eden X-VCS-Revision: 56dd9c3f8f8e5f003ad1fa73f7015e03c628fd01 X-VCS-Branch: master Date: Wed, 23 Jan 2013 12:05:28 +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: ecd4d1bd-fa42-42e3-99e4-ebc3999c39a7 X-Archives-Hash: 47c0f3ca9c6e54f04c0353734d9a1d4f commit: 56dd9c3f8f8e5f003ad1fa73f7015e03c628fd01 Author: Sven Eden gmx de> AuthorDate: Wed Jan 23 12:04:42 2013 +0000 Commit: Sven Eden gmx de> CommitDate: Wed Jan 23 12:04:42 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/ufed.git;a=commit;h=56dd9c3f Changed layout: Global descriptions no longer have a prefix. Others have ACS_VLINE + L/M + ' '/'*' for Local/Masked and unisntalled/installed. --- ufed-curses-checklist.c | 24 +++++++++++++++--------- 1 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ufed-curses-checklist.c b/ufed-curses-checklist.c index 4518375..f2cfcaf 100644 --- a/ufed-curses-checklist.c +++ b/ufed-curses-checklist.c @@ -373,10 +373,12 @@ static int drawflag(struct item *item, bool highlight) { break; // Display flag state - sprintf(buf + minwidth, "[%c] ", - flag->item.isMasked ? flag->isInstalled[idx] ? 'M' : 'm' - : flag->item.isGlobal && !flag->pkgs[idx] ? 'g' - : flag->isInstalled[idx] ? 'L' : 'l'); + bool hasScope = flag->item.isGlobal && !flag->pkgs[idx] ? false : true; + if (hasScope) { + sprintf(buf + minwidth, " %c%c ", + flag->item.isMasked ? 'M' : 'L', + flag->isInstalled[idx] ? '*' : ' '); + } // Assemble description line: memset(desc, 0, maxDescWidth * sizeof(char)); @@ -390,8 +392,9 @@ static int drawflag(struct item *item, bool highlight) { sprintf(desc, "%s", flag->descr[idx]); // Now display the description line according to its horizontal position - sprintf(buf + minwidth + 4, "%-*.*s", - wWidth(List)-minwidth - 4, wWidth(List)-minwidth - 4, + sprintf(buf + minwidth + (hasScope ? 5 : 0), "%-*.*s", + wWidth(List)-minwidth - (hasScope ? 5 : 0), + wWidth(List)-minwidth - (hasScope ? 5 : 0), strlen(desc) > (size_t)descriptionleft ? &desc[descriptionleft] : ""); @@ -399,13 +402,16 @@ static int drawflag(struct item *item, bool highlight) { /* Set correct color set according to highlighting and status*/ if(highlight) wattrset(win(List), COLOR_PAIR(3) | A_BOLD | A_REVERSE); - else if (flag->item.isGlobal && !flag->pkgs[idx]) - wattrset(win(List), COLOR_PAIR(5)); else wattrset(win(List), COLOR_PAIR(3)); // Finally put the line on the screen - waddstr(win(List), buf); + mvwaddstr(win(List), line, 0, buf); + // waddstr(win(List), buf); + if (hasScope) { + mvwaddch(win(List), line, minwidth, ACS_VLINE); + mvwaddch(win(List), line, minwidth + 3, ACS_VLINE); + } ++line; ++idx; ++usedY;