summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrés <andmarti@gmail.com>2021-05-08 21:58:01 -0300
committerAndrés <andmarti@gmail.com>2021-05-08 21:58:01 -0300
commit310ba2faf2b35d824e38cda25886ce30b6b375b8 (patch)
tree5a704ba3ee4f352d00a58313c7f44d93a5f1980e
parent64f0d525c734cffcd512c11c577f8a4fbfc80c36 (diff)
Added HELP_HIGHLIGHT definition color for help page
-rw-r--r--CHANGES2
-rw-r--r--src/color.c5
-rw-r--r--src/color.h2
-rwxr-xr-xsrc/doc5
-rw-r--r--src/help.c4
-rw-r--r--src/macros.h1
6 files changed, 15 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index 3d1126d..b1cfea2 100644
--- a/CHANGES
+++ b/CHANGES
@@ -69,6 +69,8 @@ Keep consistent with other format such as csv and save the file with the same fo
renamed GRID_PAIR to GRID_EVEN in color.c
+Added HELP_HIGHLIGHT definition color for help page
+
Pending for v0.8.2 release
diff --git a/src/color.c b/src/color.c
index e408a49..7f0f9f9 100644
--- a/src/color.c
+++ b/src/color.c
@@ -95,6 +95,7 @@ void start_default_ucolors() {
}
// Set some colors attributes
+ // NOTE: always increase N_INIT_PAIRS on each color definition you add.
ucolors[ DEFAULT ].fg = WHITE;
ucolors[ DEFAULT ].bg = DEFAULT_COLOR;
ucolors[ HEADINGS ].bg = YELLOW;
@@ -148,6 +149,8 @@ void start_default_ucolors() {
ucolors[ CELL_ERROR ].bold = 1;
ucolors[ CELL_NEGATIVE ].fg = GREEN;
ucolors[ CELL_NEGATIVE ].bg = DEFAULT_COLOR;
+ ucolors[ HELP_HIGHLIGHT ].fg = BLACK; // cell selection in spreadsheet
+ ucolors[ HELP_HIGHLIGHT ].bg = YELLOW;
ui_start_colors(); // call specific ui startup routine
}
@@ -203,6 +206,8 @@ void set_colors_param_dict() {
put(d_colors_param, "CELL_SELECTION", str);
sprintf(str, "%d", CELL_SELECTION_SC);
put(d_colors_param, "CELL_SELECTION_SC", str);
+ sprintf(str, "%d", HELP_HIGHLIGHT);
+ put(d_colors_param, "HELP_HIGHLIGHT", str);
sprintf(str, "%d", NUMB);
put(d_colors_param, "NUMB", str);
sprintf(str, "%d", STRG);
diff --git a/src/color.h b/src/color.h
index 18a26fe..20ffe1e 100644
--- a/src/color.h
+++ b/src/color.h
@@ -47,7 +47,7 @@
#include <math.h>
#define RGB(r, g, b) r*999/255, g*999/255, b*999/255
-#define N_INIT_PAIRS 24
+#define N_INIT_PAIRS 25
struct ucolor {
int fg;
diff --git a/src/doc b/src/doc
index 1c18d15..381a3b2 100755
--- a/src/doc
+++ b/src/doc
@@ -848,7 +848,8 @@ Commands for handling cell content:
EXPRESSION, GRID_EVEN, GRID_ODD,
CELL_ERROR, CELL_NEGATIVE, CELL_SELECTION,
CELL_SELECTION_SC, INFO_MSG, ERROR_MSG, CELL_ID,
- CELL_FORMAT, CELL_CONTENT, WELCOME, NORMAL, INPUT.
+ CELL_FORMAT, CELL_CONTENT, WELCOME, NORMAL, INPUT,
+ HELP_HIGHLIGHT.
The value of fg and bg shall be one of the following:
WHITE, BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN,
@@ -920,6 +921,8 @@ Commands for handling cell content:
- NORMAL Text that shows on top of the terminal (like in :help)
- INPUT The text that shows up while you type text in the
input bar at the top left of the screen.
+ - HELP_HIGHLIGHT Color used for highlighting search results
+ and titles of help page.
:cellcolor "{key}={arg} .."
Change the color of the current cell or range.
diff --git a/src/help.c b/src/help.c
index 33dec9a..6edde8a 100644
--- a/src/help.c
+++ b/src/help.c
@@ -378,7 +378,7 @@ int show_lines() {
#ifdef USECOLORS
bold && ! key?
- ui_set_ucolor(main_win, &ucolors[CELL_SELECTION_SC], DEFAULT_COLOR) :
+ ui_set_ucolor(main_win, &ucolors[HELP_HIGHLIGHT], DEFAULT_COLOR) :
ui_set_ucolor(main_win, &ucolors[NORMAL], DEFAULT_COLOR);
#endif
@@ -401,7 +401,7 @@ int show_lines() {
} else if (look_result != -1 && i >= look_result &&
i < look_result + strlen(word_looked) ) {
#ifdef USECOLORS
- ui_set_ucolor(main_win, &ucolors[CELL_SELECTION_SC], DEFAULT_COLOR);
+ ui_set_ucolor(main_win, &ucolors[HELP_HIGHLIGHT], DEFAULT_COLOR);
#endif
} else if (key) {
#ifdef USECOLORS
diff --git a/src/macros.h b/src/macros.h
index e1e3f1d..e41fb27 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -114,6 +114,7 @@
#define GRID_EVEN 21
#define GRID_ODD 22
#define HEADINGS_ODD 23
+#define HELP_HIGHLIGHT 24
void ui_sc_msg(char * s, int type, ...);
#define sc_error(x, ...) ui_sc_msg(x, ERROR_MSG, ##__VA_ARGS__)