ccmake: Use type-based colors to display cache values

The colors are based on the entry type (or value for booleans),
paths and filepaths sharing the same color.
This commit is contained in:
Sylvain Joubert
2019-10-27 18:25:41 +01:00
parent dbd14ecacf
commit 93b66735ac
9 changed files with 118 additions and 6 deletions

View File

@@ -4,6 +4,7 @@
#include <cstdio>
#include "cmCursesColor.h"
#include "cmCursesForm.h"
#include "cmCursesMainForm.h"
#include "cmCursesStandardIncludes.h"
@@ -21,8 +22,13 @@ cmCursesStringWidget::cmCursesStringWidget(int width, int height, int left,
{
this->InEdit = false;
this->Type = cmStateEnums::STRING;
set_field_fore(this->Field, A_NORMAL);
set_field_back(this->Field, A_STANDOUT);
if (cmCursesColor::HasColors()) {
set_field_fore(this->Field, COLOR_PAIR(cmCursesColor::String));
set_field_back(this->Field, COLOR_PAIR(cmCursesColor::String));
} else {
set_field_fore(this->Field, A_NORMAL);
set_field_back(this->Field, A_STANDOUT);
}
field_opts_off(this->Field, O_STATIC);
}