rcfile: add 'set scrollercolor', for changing the color of the indicator

This fulfills https://savannah.gnu.org/bugs/?59041.
master
Benno Schulenberg 2020-08-28 18:40:10 +02:00
parent 79545187b8
commit 46e769a113
5 changed files with 8 additions and 2 deletions

View File

@ -64,7 +64,7 @@ void set_interface_colorpairs(void)
interface_color_pair[index] = COLOR_PAIR(index + 1) | A_BANDAID |
combo->attributes;
} else {
if (index == FUNCTION_TAG)
if (index == FUNCTION_TAG || index == SCROLL_BAR)
interface_color_pair[index] = A_NORMAL;
else if (index == GUIDE_STRIPE)
interface_color_pair[index] = A_REVERSE;

View File

@ -481,6 +481,7 @@ enum
TITLE_BAR = 0,
LINE_NUMBER,
GUIDE_STRIPE,
SCROLL_BAR,
SELECTED_TEXT,
STATUS_BAR,
ERROR_MESSAGE,

View File

@ -2297,6 +2297,7 @@ int main(int argc, char **argv)
interface_color_pair[TITLE_BAR] = hilite_attribute;
interface_color_pair[LINE_NUMBER] = hilite_attribute;
interface_color_pair[GUIDE_STRIPE] = A_REVERSE;
interface_color_pair[SCROLL_BAR] = A_NORMAL;
interface_color_pair[SELECTED_TEXT] = hilite_attribute;
interface_color_pair[STATUS_BAR] = hilite_attribute;
interface_color_pair[ERROR_MESSAGE] = hilite_attribute;

View File

@ -126,6 +126,7 @@ static const rcoption rcopts[] = {
{"titlecolor", 0},
{"numbercolor", 0},
{"stripecolor", 0},
{"scrollercolor", 0},
{"selectedcolor", 0},
{"statuscolor", 0},
{"errorcolor", 0},
@ -1551,6 +1552,8 @@ void parse_rcfile(FILE *rcstream, bool just_syntax, bool intros_only)
color_combo[LINE_NUMBER] = parse_interface_color(argument);
else if (strcmp(option, "stripecolor") == 0)
color_combo[GUIDE_STRIPE] = parse_interface_color(argument);
else if (strcmp(option, "scrollercolor") == 0)
color_combo[SCROLL_BAR] = parse_interface_color(argument);
else if (strcmp(option, "selectedcolor") == 0)
color_combo[SELECTED_TEXT] = parse_interface_color(argument);
else if (strcmp(option, "statuscolor") == 0)

View File

@ -2882,7 +2882,8 @@ void draw_scrollbar(void)
highest = editwinrows;
for (int row = 0; row < editwinrows; row++) {
bardata[row] = ' '|((row >= lowest && row <= highest) ? A_REVERSE : 0);
bardata[row] = ' '|interface_color_pair[SCROLL_BAR]|
((row < lowest || row > highest) ? A_NORMAL : A_REVERSE);
mvwaddch(edit, row, COLS - 1, bardata[row]);
}
}