summaryrefslogtreecommitdiffstats
path: root/Source/CursesDialog/cmCursesOptionsWidget.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/cmCursesOptionsWidget.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/cmCursesOptionsWidget.cxx')
-rw-r--r--Source/CursesDialog/cmCursesOptionsWidget.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/CursesDialog/cmCursesOptionsWidget.cxx b/Source/CursesDialog/cmCursesOptionsWidget.cxx
index eb773ad..a15241f 100644
--- a/Source/CursesDialog/cmCursesOptionsWidget.cxx
+++ b/Source/CursesDialog/cmCursesOptionsWidget.cxx
@@ -2,6 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCursesOptionsWidget.h"
+#include "cmCursesColor.h"
#include "cmCursesWidget.h"
#include "cmStateTypes.h"
@@ -15,8 +16,13 @@ cmCursesOptionsWidget::cmCursesOptionsWidget(int width, int height, int left,
// there is no option type, and string type causes ccmake to cast
// the widget into a string widget at some point. BOOL is safe for
// now.
- 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::Options));
+ set_field_back(this->Field, COLOR_PAIR(cmCursesColor::Options));
+ } else {
+ set_field_fore(this->Field, A_NORMAL);
+ set_field_back(this->Field, A_STANDOUT);
+ }
field_opts_off(this->Field, O_STATIC);
}