Skip to content

Changing the makefile for a better definition of the prefix, added 2 new color definitions for theme using 2 colors for colums, which collided with the help file #934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ src/debug.sh
src/debuga.sh
src/a.sc
src/lua
src/local.mk

13 changes: 11 additions & 2 deletions src/Makefile
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
# Specify the name of the resulting executable file
name = sc-im

# The base directory where everything should be installed.
prefix = /usr/local
# The base directory of the installation can be defined in
# the file local.mk The variable prefix has to be set in that file.
# Otherwise the default value is /usr/local

-include local.mk

ifndef prefix
prefix = /usr/local
endif

$(info Installation prefix directory is $(prefix))

EXDIR = $(prefix)/bin
HELPDIR = $(prefix)/share/$(name)
Expand Down
8 changes: 8 additions & 0 deletions src/color.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ void start_default_ucolors() {
ucolors[ SHEET ].bg = DEFAULT_COLOR;
ucolors[ FILENM ].fg = GREEN;
ucolors[ FILENM ].bg = DEFAULT_COLOR;
ucolors[ HELP_TEXT ].fg = WHITE;
ucolors[ HELP_TEXT ].fg = WHITE;
ucolors[ HELP_KEYDEF ].fg = WHITE;
ucolors[ HELP_KEYDEF ].bg = BLACK;

ui_start_colors(); // call specific ui startup routine
}
Expand Down Expand Up @@ -256,6 +260,10 @@ void set_colors_param_dict() {
put(d_colors_param, "SHEET", str);
sprintf(str, "%d", FILENM);
put(d_colors_param, "FILENM", str);
sprintf(str, "%d", HELP_TEXT);
put(d_colors_param, "HELP_TEXT", str);
sprintf(str, "%d", HELP_KEYDEF);
put(d_colors_param, "HELP_KEYDEF", str);
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#include <math.h>
#define RGB(r, g, b) r*999/255, g*999/255, b*999/255

#define N_INIT_PAIRS 28
#define N_INIT_PAIRS 30

#define HEADINGS 0
#define WELCOME 1
Expand Down Expand Up @@ -78,6 +78,8 @@
#define SHEET 25
#define CURRENT_SHEET 26
#define FILENM 27
#define HELP_TEXT 28
#define HELP_KEYDEF 29

struct ucolor {
int fg;
Expand Down
5 changes: 4 additions & 1 deletion src/doc
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ Commands for handling cell content:
CELL_ERROR, CELL_NEGATIVE, CELL_SELECTION,
CELL_SELECTION_SC, INFO_MSG, ERROR_MSG, CELL_ID,
CELL_FORMAT, CELL_CONTENT, WELCOME, NORMAL, INPUT,
HELP_HIGHLIGHT.
HELP_HIGHLIGHT, HELP_TEXT, HELP_KEYDEF.

The value of fg and bg shall be one of the following:
WHITE, BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN,
Expand Down Expand Up @@ -966,6 +966,9 @@ Commands for handling cell content:
input bar at the top left of the screen.
- HELP_HIGHLIGHT Color used for highlighting search results
and titles of help page.
- HELP_TEXT Color used for the text of the help page.
- HELP_KEYDEF Color used for the key definitions in the
help page.

:cellcolor "{key}={arg} .."
Change the color of the current cell or range.
Expand Down
4 changes: 2 additions & 2 deletions src/help.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ int show_lines() {
#ifdef USECOLORS
bold && ! key?
ui_set_ucolor(main_win, &ucolors[HELP_HIGHLIGHT], DEFAULT_COLOR) :
ui_set_ucolor(main_win, &ucolors[NORMAL], DEFAULT_COLOR);
ui_set_ucolor(main_win, &ucolors[HELP_TEXT], DEFAULT_COLOR);
#endif

if (long_help[lineno + delta][i] == '<' || long_help[lineno + delta][i] == '{') {
Expand All @@ -411,7 +411,7 @@ int show_lines() {
#endif
} else if (key) {
#ifdef USECOLORS
ui_set_ucolor(main_win, &ucolors[NUMB], DEFAULT_COLOR);
ui_set_ucolor(main_win, &ucolors[HELP_KEYDEF], DEFAULT_COLOR);
#endif
}

Expand Down
41 changes: 41 additions & 0 deletions themes/duo-color.sc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
DEFINE_COLOR "comment" 121 112 169
DEFINE_COLOR "altbackground" 63 63 63
DEFINE_COLOR "BG1" 254 247 219
DEFINE_COLOR "BG2" 244 221 178
DEFINE_COLOR "BG_SELECT" 129 162 190
DEFINE_COLOR "EXP" 129 162 190
DEFINE_COLOR "STR" 129 162 190
DEFINE_COLOR "DATE" 129 162 190
DEFINE_COLOR "HEADER1" 126 126 126
DEFINE_COLOR "HEADER2" 228 228 228
DEFINE_COLOR "HEADERTXT" 188 182 106

color "type=WELCOME fg=YELLOW bg=BLACK bold=0"
color "type=NORMAL fg=WHITE bg=NONE_COLOR bold=0"
color "type=DEFAULT fg=WHITE bg=BLACK bold=0 italic=0"
color "type=FILENM fg=WHITE bg=BLACK bold=1"
color "type=SHEET fg=comment bg=BG1 bold=0"
color "type=CURRENT_SHEET fg=WHITE bg=BLACK bold=1"
color "type=MODE fg=WHITE bg=BLACK bold=0"
color "type=INFO_MSG fg=WHITE bg=BLACK bold=1"
color "type=ERROR_MSG fg=RED bg=BLACK bold=1"
color "type=INPUT fg=WHITE bg=BLACK bold=1"
color "type=HEADINGS fg=HEADERTXT bg=HEADER1 bold=0"
color "type=HEADINGS_ODD fg=HEADERTXT bg=HEADER2 bold=0"
color "type=CELL_ID fg=WHITE bg=BLACK bold=0"
color "type=CELL_FORMAT fg=WHITE bg=BLACK bold=0"
color "type=CELL_CONTENT fg=WHITE bg=BLACK bold=0"
color "type=CELL_ERROR fg=BLACK bg=RED bold=1"
color "type=CELL_NEGATIVE fg=BLACK bg=NONE_COLOR bold=0 reverse=0"
color "type=CELL_SELECTION fg=WHITE bg=BG_SELECT bold=0"
color "type=CELL_SELECTION_SC fg=WHITE bg=BG_SELECT bold=1"
color "type=NUMB fg=BLACK bg=NONE_COLOR bold=0"
color "type=STRG fg=STR bg=NONE_COLOR bold=0 italic=0"
color "type=DATEF fg=DATE bg=NONE_COLOR"
color "type=GRID_EVEN fg=GREEN bg=BG1"
color "type=GRID_ODD fg=WHITE bg=BG2"
color "type=EXPRESSION fg=EXP bg=NONE_COLOR bold=0"
color "type=HELP_TEXT fg=WHITE bg=BLACK bold=0"
color "type=HELP_HIGHLIGHT fg=WHITE bg=BLACK bold=1"
color "type=HELP_KEYDEF fg=YELLOW bg=BLACK bold=1"