summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Eden <sven.eden@gmx.de>2013-02-12 11:52:02 +0100
committerSven Eden <sven.eden@gmx.de>2013-02-12 11:52:02 +0100
commit7c4b4e4397ecc9ddbf9c6cc9e2c1cbe0da9165e9 (patch)
treeec25e5f5ef291de5ae82e928f5c36373fea3367b /ufed-curses-checklist.c
parentBeautified the help line a bit. However, it must be redesigned and the functi... (diff)
downloadufed-7c4b4e4397ecc9ddbf9c6cc9e2c1cbe0da9165e9.tar.gz
ufed-7c4b4e4397ecc9ddbf9c6cc9e2c1cbe0da9165e9.tar.bz2
ufed-7c4b4e4397ecc9ddbf9c6cc9e2c1cbe0da9165e9.zip
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.
Diffstat (limited to 'ufed-curses-checklist.c')
-rw-r--r--ufed-curses-checklist.c20
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 {