From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-558110-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id E55001389C6
	for <garchives@archives.gentoo.org>; Tue, 12 Feb 2013 10:51:12 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 47025E0205;
	Tue, 12 Feb 2013 10:51:12 +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 C35B8E0205
	for <gentoo-commits@lists.gentoo.org>; Tue, 12 Feb 2013 10:51:11 +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 9AED233E64B
	for <gentoo-commits@lists.gentoo.org>; Tue, 12 Feb 2013 10:51:10 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by hornbill.gentoo.org (Postfix) with ESMTP id 3BC44E407B
	for <gentoo-commits@lists.gentoo.org>; Tue, 12 Feb 2013 10:51:09 +0000 (UTC)
From: "Sven Eden" <sven.eden@gmx.de>
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" <sven.eden@gmx.de>
Message-ID: <1360666322.7c4b4e4397ecc9ddbf9c6cc9e2c1cbe0da9165e9.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: 7c4b4e4397ecc9ddbf9c6cc9e2c1cbe0da9165e9
X-VCS-Branch: master
Date: Tue, 12 Feb 2013 10:51:09 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: cc09a436-6966-45f0-86fb-bec257d8e576
X-Archives-Hash: fb461ad714faa6d53b7cf9a0d6897c85

commit:     7c4b4e4397ecc9ddbf9c6cc9e2c1cbe0da9165e9
Author:     Sven Eden <sven.eden <AT> gmx <DOT> de>
AuthorDate: Tue Feb 12 10:52:02 2013 +0000
Commit:     Sven Eden <sven.eden <AT> gmx <DOT> de>
CommitDate: Tue Feb 12 10:52:02 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/ufed.git;a=commit;h=7c4b4e43

Fixed masked/forced display to be (flag) for forced and (-flag) for masked flags. This is the way they are displayed by portage. Further changed the default selection to no longer be A_BOLD, as this turned out to be gray, making the '-' almost invisible. Finally fixed a bug that allowed globally forced flags to be toggled.

---
 ufed-curses-checklist.c |   20 ++++++--------------
 1 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/ufed-curses-checklist.c b/ufed-curses-checklist.c
index 9136256..e871156 100644
--- a/ufed-curses-checklist.c
+++ b/ufed-curses-checklist.c
@@ -258,12 +258,12 @@ static int drawflag(sFlag* flag, bool highlight)
 					' ', // Filled in later
 					flag->stateConf == ' ' ? ')' : ']',
 					/* name */
-					flag->globalForced ? "(+" : flag->globalMasked ? "(" : "",
+					flag->globalForced ? "(" : flag->globalMasked ? "(-" : "",
 					flag->name,
 					(flag->globalForced || flag->globalMasked) ? ")" : "",
 					/* distance */
 					(int)(minwidth
-						- (flag->globalForced ? 2 : flag->globalMasked ? 3 : 5)
+						- (flag->globalForced ? 3 : flag->globalMasked ? 2 : 5)
 						- strlen(flag->name)), " ");
 					// At this point buf is filled up to minwidth
 			} // End of generating left side mask display
@@ -328,13 +328,9 @@ static int drawflag(sFlag* flag, bool highlight)
 					else
 						wattrset(wLst, COLOR_PAIR(4) | A_BOLD);
 					mvwaddch(wLst, line, 2, '-');
-				} else if (' ' == flag->stateConf) {
-					if(highlight)
-						wattrset(wLst, COLOR_PAIR(3) | A_REVERSE);
-					else
-						wattrset(wLst, COLOR_PAIR(3) | A_BOLD);
+				} else if (' ' == flag->stateConf)
 					mvwaddch(wLst, line, 2, flag->stateDefault);
-				} else
+				else
 					mvwaddch(wLst, line, 2, flag->stateConf);
 			}
 
@@ -352,10 +348,6 @@ static int drawflag(sFlag* flag, bool highlight)
 					wattrset(wLst, COLOR_PAIR(4) | A_BOLD);
 				mvwaddch(wLst, line, minwidth + 1, special);
 			} else {
-				if(highlight)
-					wattrset(wLst, COLOR_PAIR(3) | A_BOLD | A_REVERSE);
-				else
-					wattrset(wLst, COLOR_PAIR(3));
 				if (' ' == flag->desc[idx].stateDefault)
 					mvwaddch(wLst, line, minwidth + 1, flag->stateDefault);
 				else
@@ -432,7 +424,7 @@ static int callback(sFlag** curr, int key)
 			break;
 		case ' ':
 			// Masked flags can be turned off, nothing else
-			if ( (*curr)->globalMasked ) {
+			if ( (*curr)->globalMasked || (*curr)->globalForced ) {
 				if (' ' != (*curr)->stateConf)
 					(*curr)->stateConf = ' ';
 			} else {
@@ -517,7 +509,7 @@ static int callback(sFlag** curr, int key)
 #ifdef NCURSES_MOUSE_VERSION
 		case KEY_MOUSE:
 			// Masked flags can be turned off, nothing else
-			if ( (*curr)->globalMasked ) {
+			if ( (*curr)->globalMasked || (*curr)->globalForced ) {
 				if (' ' != (*curr)->stateConf)
 					(*curr)->stateConf = ' ';
 			} else {