mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
Merge branch '1667_hardcoded_colors'
* 1667_hardcoded_colors: Fix colors showing for compile with S-Lang library Ticket #1667: Hardcoded colours
This commit is contained in:
commit
20cd37d751
@ -12,13 +12,9 @@
|
||||
#include "edit-impl.h"
|
||||
#include "../src/keybind.h"
|
||||
|
||||
|
||||
#define MAX_MACRO_LENGTH 1024
|
||||
#define N_LINE_CACHES 32
|
||||
|
||||
#define BOOK_MARK_COLOR ((25 << 8) | 5)
|
||||
#define BOOK_MARK_FOUND_COLOR ((26 << 8) | 4)
|
||||
|
||||
struct _book_mark {
|
||||
int line; /* line number */
|
||||
int c; /* color */
|
||||
|
@ -49,6 +49,7 @@
|
||||
#include "../src/tty/color.h" /* EDITOR_NORMAL_COLOR */
|
||||
#include "../src/tty/tty.h" /* attrset() */
|
||||
#include "../src/tty/key.h" /* is_idle() */
|
||||
#include "../src/skin/skin.h" /* mc_skin_color_get */
|
||||
|
||||
#include "../src/widget.h" /* buttonbar_redraw() */
|
||||
#include "../src/cmd.h" /* view_other_cmd() */
|
||||
|
@ -60,6 +60,7 @@
|
||||
#include "../src/selcodepage.h"
|
||||
#include "../src/strutil.h" /* utf string functions */
|
||||
#include "../src/mcconfig/mcconfig.h"
|
||||
#include "../src/skin/skin.h" /* mc_skin_color_get */
|
||||
|
||||
#include "../edit/edit-impl.h"
|
||||
#include "../edit/edit.h"
|
||||
|
@ -72,6 +72,8 @@
|
||||
editmarked=black;cyan
|
||||
editwhitespace=brightblue;blue
|
||||
linestate=white;cyan
|
||||
bookmark=white;red
|
||||
bookmarkfound=black;green
|
||||
|
||||
[viewer]
|
||||
viewunderline=brightred;blue
|
||||
|
@ -72,6 +72,8 @@
|
||||
editmarked=black;cyan
|
||||
editwhitespace=brightblue;blue
|
||||
linestate=white;cyan
|
||||
bookmark=white;red
|
||||
bookmarkfound=black;green
|
||||
|
||||
[viewer]
|
||||
viewunderline=brightred;blue
|
||||
|
@ -74,6 +74,8 @@
|
||||
editmarked=black;cyan
|
||||
editwhitespace=brightblue;blue
|
||||
linestate=white;cyan
|
||||
bookmark=white;red
|
||||
bookmarkfound=black;green
|
||||
|
||||
[viewer]
|
||||
viewunderline=brightred;blue
|
||||
|
@ -228,6 +228,10 @@ mc_skin_color_cache_init (void)
|
||||
EDITOR_MARKED_COLOR = mc_skin_color_get ("editor", "editmarked");
|
||||
EDITOR_WHITESPACE_COLOR = mc_skin_color_get ("editor", "editwhitespace");
|
||||
LINE_STATE_COLOR = mc_skin_color_get ("editor", "linestate");
|
||||
BOOK_MARK_COLOR = mc_skin_color_get ("editor", "bookmark");
|
||||
BOOK_MARK_FOUND_COLOR = mc_skin_color_get ("editor", "bookmarkfound");
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -63,8 +63,10 @@
|
||||
#define EDITOR_WHITESPACE_COLOR mc_skin_color__cache[28]
|
||||
/* color of left 8 char status per line */
|
||||
#define LINE_STATE_COLOR mc_skin_color__cache[29]
|
||||
#define BOOK_MARK_COLOR mc_skin_color__cache[30]
|
||||
#define BOOK_MARK_FOUND_COLOR mc_skin_color__cache[31]
|
||||
|
||||
#define MC_SKIN_COLOR_CACHE_COUNT 30
|
||||
#define MC_SKIN_COLOR_CACHE_COUNT 32
|
||||
|
||||
|
||||
/*** enums ***************************************************************************************/
|
||||
|
@ -142,17 +142,7 @@ tty_color_try_alloc_pair_lib (tty_color_pair_t * mc_color_pair)
|
||||
void
|
||||
tty_setcolor (int color)
|
||||
{
|
||||
if (!SLtt_Use_Ansi_Colors)
|
||||
SLsmg_set_color (color);
|
||||
else if ((color & A_BOLD) != 0) {
|
||||
if (color == A_BOLD)
|
||||
SLsmg_set_color (A_BOLD);
|
||||
else
|
||||
SLsmg_set_color ((color & (~A_BOLD)) + 8);
|
||||
} else if (color == A_REVERSE)
|
||||
SLsmg_set_color (A_REVERSE);
|
||||
else
|
||||
SLsmg_set_color (color);
|
||||
SLsmg_set_color (color);
|
||||
}
|
||||
|
||||
/* Set colorpair by index, don't interpret S-Lang "emulated attributes" */
|
||||
|
@ -22,13 +22,9 @@ enum {
|
||||
/* When using Slang with color, we have all the indexes free but
|
||||
* those defined here (A_BOLD, A_UNDERLINE, A_REVERSE, A_BOLD_REVERSE)
|
||||
*/
|
||||
#define A_BOLD 0x40
|
||||
#define A_UNDERLINE 0x40
|
||||
#define A_REVERSE 0x20
|
||||
#define A_BOLD_REVERSE 0x21
|
||||
|
||||
#ifndef A_NORMAL
|
||||
# define A_NORMAL 0x00
|
||||
#endif
|
||||
#ifndef A_BOLD
|
||||
#define A_BOLD SLTT_BOLD_MASK
|
||||
#endif /* A_BOLD */
|
||||
|
||||
#endif /* MC_COLOR_SLANG_H */
|
||||
|
Loading…
Reference in New Issue
Block a user