summaryrefslogtreecommitdiffstats
path: root/Source/CursesDialog/cmCursesStringWidget.cxx
diff options
context:
space:
mode:
authorSylvain Joubert <joubert.sy@gmail.com>2019-10-27 17:25:41 (GMT)
committerSylvain Joubert <joubert.sy@gmail.com>2019-11-04 17:59:20 (GMT)
commit93b66735ac2092675eec7a636625df84ff306fdc (patch)
treeb58c050ad714fa7ea5467f90d26873e764bfa7ea /Source/CursesDialog/cmCursesStringWidget.cxx
parentdbd14ecacf9b85dcdf5f566538167261dba224fe (diff)
downloadCMake-93b66735ac2092675eec7a636625df84ff306fdc.zip
CMake-93b66735ac2092675eec7a636625df84ff306fdc.tar.gz
CMake-93b66735ac2092675eec7a636625df84ff306fdc.tar.bz2
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.
Diffstat (limited to 'Source/CursesDialog/cmCursesStringWidget.cxx')
-rw-r--r--Source/CursesDialog/cmCursesStringWidget.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx
index 6296af2..c629478 100644
--- a/Source/CursesDialog/cmCursesStringWidget.cxx
+++ b/Source/CursesDialog/cmCursesStringWidget.cxx
@@ -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);
}