From b34958388782a4d83f75e06a8da7a61d31f90cab Mon Sep 17 00:00:00 2001 From: Egmont Koblinger Date: Wed, 28 Jan 2026 13:24:48 +0100 Subject: [PATCH 1/5] Rename the input widget's color enums to be consistent with dialog widget Signed-off-by: Egmont Koblinger --- lib/widget/input.c | 20 ++++++++++---------- lib/widget/input.h | 12 ++++++------ src/filemanager/command.c | 8 ++++---- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/widget/input.c b/lib/widget/input.c index f850f51b2f..bf5d55cbff 100644 --- a/lib/widget/input.c +++ b/lib/widget/input.c @@ -115,7 +115,7 @@ draw_history_button (WInput *in) widget_gotoyx (in, 0, WIDGET (in)->rect.cols - HISTORY_BUTTON_WIDTH); disabled = widget_get_state (WIDGET (in), WST_DISABLED); - tty_setcolor (disabled ? CORE_DISABLED_COLOR : in->color[WINPUTC_HISTORY]); + tty_setcolor (disabled ? CORE_DISABLED_COLOR : in->color[INPUT_COLOR_HISTORY]); #ifdef LARGE_HISTORY_BUTTON tty_print_string ("[ ]"); @@ -1081,10 +1081,10 @@ input_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *dat void input_set_default_colors (void) { - input_colors[WINPUTC_MAIN] = CORE_INPUT_COLOR; - input_colors[WINPUTC_MARK] = CORE_INPUT_MARK_COLOR; - input_colors[WINPUTC_UNCHANGED] = CORE_INPUT_UNCHANGED_COLOR; - input_colors[WINPUTC_HISTORY] = CORE_INPUT_HISTORY_COLOR; + input_colors[INPUT_COLOR_MAIN] = CORE_INPUT_COLOR; + input_colors[INPUT_COLOR_MARK] = CORE_INPUT_MARK_COLOR; + input_colors[INPUT_COLOR_UNCHANGED] = CORE_INPUT_UNCHANGED_COLOR; + input_colors[INPUT_COLOR_HISTORY] = CORE_INPUT_HISTORY_COLOR; } /* --------------------------------------------------------------------------------------------- */ @@ -1226,9 +1226,9 @@ input_update (WInput *in, gboolean clear_first) if (widget_get_state (wi, WST_DISABLED)) tty_setcolor (CORE_DISABLED_COLOR); else if (in->first) - tty_setcolor (in->color[WINPUTC_UNCHANGED]); + tty_setcolor (in->color[INPUT_COLOR_UNCHANGED]); else - tty_setcolor (in->color[WINPUTC_MAIN]); + tty_setcolor (in->color[INPUT_COLOR_MAIN]); widget_gotoyx (in, 0, 0); @@ -1243,11 +1243,11 @@ input_update (WInput *in, gboolean clear_first) if (input_eval_marks (in, &m1, &m2)) { - tty_setcolor (in->color[WINPUTC_MAIN]); + tty_setcolor (in->color[INPUT_COLOR_MAIN]); cp = str_term_substring (in->buffer->str, in->term_first_shown, w->cols - has_history); tty_print_string (cp); - tty_setcolor (in->color[WINPUTC_MARK]); + tty_setcolor (in->color[INPUT_COLOR_MARK]); if (m1 < in->term_first_shown) { widget_gotoyx (in, 0, 0); @@ -1273,7 +1273,7 @@ input_update (WInput *in, gboolean clear_first) int i; cp = str_term_substring (in->buffer->str, in->term_first_shown, w->cols - has_history); - tty_setcolor (in->color[WINPUTC_MAIN]); + tty_setcolor (in->color[INPUT_COLOR_MAIN]); for (i = 0; i < w->cols - has_history; i++) { if (i < (buf_len - in->term_first_shown) && cp[0] != '\0') diff --git a/lib/widget/input.h b/lib/widget/input.h index 91a589009f..81b25040c8 100644 --- a/lib/widget/input.h +++ b/lib/widget/input.h @@ -19,11 +19,11 @@ typedef enum { - WINPUTC_MAIN, // color used - WINPUTC_MARK, // color for marked text - WINPUTC_UNCHANGED, // color for inactive text (Is first keystroke) - WINPUTC_HISTORY, // color for history list - WINPUTC_COUNT_COLORS // count of used colors + INPUT_COLOR_MAIN, // color used + INPUT_COLOR_MARK, // color for marked text + INPUT_COLOR_UNCHANGED, // color for inactive text (Is first keystroke) + INPUT_COLOR_HISTORY, // color for history list + INPUT_COLOR_COUNT // count of used colors } input_colors_enum_t; /* completion flags */ @@ -41,7 +41,7 @@ typedef enum /*** structures declarations (and typedefs of structures)*****************************************/ -typedef int input_colors_t[WINPUTC_COUNT_COLORS]; +typedef int input_colors_t[INPUT_COLOR_COUNT]; typedef struct { diff --git a/src/filemanager/command.c b/src/filemanager/command.c index 5f10a6715c..812646f7fa 100644 --- a/src/filemanager/command.c +++ b/src/filemanager/command.c @@ -229,10 +229,10 @@ command_new (int y, int x, int cols) void command_set_default_colors (void) { - command_colors[WINPUTC_MAIN] = CORE_DEFAULT_COLOR; - command_colors[WINPUTC_MARK] = CORE_COMMAND_MARK_COLOR; - command_colors[WINPUTC_UNCHANGED] = CORE_DEFAULT_COLOR; - command_colors[WINPUTC_HISTORY] = CORE_COMMAND_HISTORY_COLOR; + command_colors[INPUT_COLOR_MAIN] = CORE_DEFAULT_COLOR; + command_colors[INPUT_COLOR_MARK] = CORE_COMMAND_MARK_COLOR; + command_colors[INPUT_COLOR_UNCHANGED] = CORE_DEFAULT_COLOR; + command_colors[INPUT_COLOR_HISTORY] = CORE_COMMAND_HISTORY_COLOR; } /* --------------------------------------------------------------------------------------------- */ From 284d03494053c6335fa51cce88d178b3874d19ca Mon Sep 17 00:00:00 2001 From: Egmont Koblinger Date: Wed, 28 Jan 2026 13:29:19 +0100 Subject: [PATCH 2/5] Ticket #4974: Make the hint bar, shell prompt and command line skinnable New keywords "hintbar", "prompt" and "commandline" under the "[core]" section of skin files control the colors of these parts of the screen. Update the skins to still use terminal's default colors here, as before. Remove the hline widget's unused transparent parameter, so that our widgets don't have this concept anymore. Fix some typos in comments. Signed-off-by: Egmont Koblinger --- lib/skin.h | 167 ++++++++++++----------- lib/skin/colors.c | 3 + lib/widget/hline.c | 14 +- lib/widget/hline.h | 1 - lib/widget/input.c | 2 +- lib/widget/input.h | 2 +- lib/widget/label.c | 40 ++++-- lib/widget/label.h | 19 ++- misc/skins/README.txt | 9 ++ misc/skins/dark.ini | 3 + misc/skins/darkfar.ini | 3 + misc/skins/default.ini | 3 + misc/skins/double-lines.ini | 3 + misc/skins/featured-plus.ini | 3 + misc/skins/featured.ini | 3 + misc/skins/gray-green-purple256.ini | 3 + misc/skins/gray-orange-blue256.ini | 3 + misc/skins/julia256.ini | 3 + misc/skins/julia256root.ini | 3 + misc/skins/mc46.ini | 3 + misc/skins/modarcon16-defbg-thin.ini | 3 + misc/skins/modarcon16-defbg.ini | 3 + misc/skins/modarcon16-thin.ini | 3 + misc/skins/modarcon16.ini | 3 + misc/skins/modarcon16root-defbg-thin.ini | 3 + misc/skins/modarcon16root-defbg.ini | 3 + misc/skins/modarcon16root-thin.ini | 3 + misc/skins/modarcon16root.ini | 3 + misc/skins/modarin256-defbg-thin.ini | 3 + misc/skins/modarin256-defbg.ini | 3 + misc/skins/modarin256-thin.ini | 3 + misc/skins/modarin256.ini | 3 + misc/skins/modarin256root-defbg-thin.ini | 3 + misc/skins/modarin256root-defbg.ini | 3 + misc/skins/modarin256root-thin.ini | 3 + misc/skins/modarin256root.ini | 3 + misc/skins/nicedark.ini | 3 + misc/skins/sand256.ini | 3 + misc/skins/seasons-autumn16M.ini | 3 + misc/skins/seasons-spring16M.ini | 3 + misc/skins/seasons-summer16M.ini | 3 + misc/skins/seasons-winter16M.ini | 3 + misc/skins/xoria256-thin.ini | 3 + misc/skins/xoria256.ini | 3 + misc/skins/xoria256root-thin.ini | 3 + misc/skins/yadt256-defbg.ini | 3 + misc/skins/yadt256.ini | 3 + src/filemanager/boxes.c | 1 + src/filemanager/command.c | 4 +- src/filemanager/filemanager.c | 4 +- src/main.c | 1 + 51 files changed, 270 insertions(+), 111 deletions(-) diff --git a/lib/skin.h b/lib/skin.h index 7c8c6a2cf4..504bfd70c4 100644 --- a/lib/skin.h +++ b/lib/skin.h @@ -13,112 +13,115 @@ See color-slang.h (A_*) */ /* cache often used colors */ -#define CORE_DEFAULT_COLOR mc_skin_color__cache[0] -#define CORE_NORMAL_COLOR mc_skin_color__cache[1] -#define CORE_MARKED_COLOR mc_skin_color__cache[2] -#define CORE_SELECTED_COLOR mc_skin_color__cache[3] -#define CORE_MARKED_SELECTED_COLOR mc_skin_color__cache[4] -#define CORE_DISABLED_COLOR mc_skin_color__cache[5] -#define CORE_REVERSE_COLOR mc_skin_color__cache[6] -#define CORE_COMMAND_MARK_COLOR mc_skin_color__cache[7] -#define CORE_HEADER_COLOR mc_skin_color__cache[8] -#define CORE_SHADOW_COLOR mc_skin_color__cache[9] -#define CORE_FRAME_COLOR mc_skin_color__cache[10] +#define CORE_DEFAULT_COLOR mc_skin_color__cache[80] // removed in the second next commit +#define CORE_NORMAL_COLOR mc_skin_color__cache[0] +#define CORE_MARKED_COLOR mc_skin_color__cache[1] +#define CORE_SELECTED_COLOR mc_skin_color__cache[2] +#define CORE_MARKED_SELECTED_COLOR mc_skin_color__cache[3] +#define CORE_DISABLED_COLOR mc_skin_color__cache[4] +#define CORE_REVERSE_COLOR mc_skin_color__cache[5] +#define CORE_HINTBAR_COLOR mc_skin_color__cache[6] +#define CORE_PROMPT_COLOR mc_skin_color__cache[7] +#define CORE_COMMAND_COLOR mc_skin_color__cache[8] +#define CORE_COMMAND_MARK_COLOR mc_skin_color__cache[9] +#define CORE_HEADER_COLOR mc_skin_color__cache[10] +#define CORE_SHADOW_COLOR mc_skin_color__cache[11] +#define CORE_FRAME_COLOR mc_skin_color__cache[12] /* Dialog colors */ -#define DIALOG_NORMAL_COLOR mc_skin_color__cache[11] -#define DIALOG_FOCUS_COLOR mc_skin_color__cache[12] -#define DIALOG_HOT_NORMAL_COLOR mc_skin_color__cache[13] -#define DIALOG_HOT_FOCUS_COLOR mc_skin_color__cache[14] -#define DIALOG_SELECTED_NORMAL_COLOR mc_skin_color__cache[15] -#define DIALOG_SELECTED_FOCUS_COLOR mc_skin_color__cache[16] -#define DIALOG_TITLE_COLOR mc_skin_color__cache[17] -#define DIALOG_FRAME_COLOR mc_skin_color__cache[18] +#define DIALOG_NORMAL_COLOR mc_skin_color__cache[13] +#define DIALOG_FOCUS_COLOR mc_skin_color__cache[14] +#define DIALOG_HOT_NORMAL_COLOR mc_skin_color__cache[15] +#define DIALOG_HOT_FOCUS_COLOR mc_skin_color__cache[16] +#define DIALOG_SELECTED_NORMAL_COLOR mc_skin_color__cache[17] +#define DIALOG_SELECTED_FOCUS_COLOR mc_skin_color__cache[18] +#define DIALOG_TITLE_COLOR mc_skin_color__cache[19] +#define DIALOG_FRAME_COLOR mc_skin_color__cache[20] /* Error dialog colors */ -#define ERROR_NORMAL_COLOR mc_skin_color__cache[19] -#define ERROR_FOCUS_COLOR mc_skin_color__cache[20] -#define ERROR_HOT_NORMAL_COLOR mc_skin_color__cache[21] -#define ERROR_HOT_FOCUS_COLOR mc_skin_color__cache[22] -#define ERROR_TITLE_COLOR mc_skin_color__cache[23] -#define ERROR_FRAME_COLOR mc_skin_color__cache[24] +#define ERROR_NORMAL_COLOR mc_skin_color__cache[21] +#define ERROR_FOCUS_COLOR mc_skin_color__cache[22] +#define ERROR_HOT_NORMAL_COLOR mc_skin_color__cache[23] +#define ERROR_HOT_FOCUS_COLOR mc_skin_color__cache[24] +#define ERROR_TITLE_COLOR mc_skin_color__cache[25] +#define ERROR_FRAME_COLOR mc_skin_color__cache[26] /* Menu colors */ -#define MENU_ENTRY_COLOR mc_skin_color__cache[25] -#define MENU_SELECTED_COLOR mc_skin_color__cache[26] -#define MENU_HOT_COLOR mc_skin_color__cache[27] -#define MENU_HOTSEL_COLOR mc_skin_color__cache[28] -#define MENU_INACTIVE_COLOR mc_skin_color__cache[29] -#define MENU_FRAME_COLOR mc_skin_color__cache[30] +#define MENU_ENTRY_COLOR mc_skin_color__cache[27] +#define MENU_SELECTED_COLOR mc_skin_color__cache[28] +#define MENU_HOT_COLOR mc_skin_color__cache[29] +#define MENU_HOTSEL_COLOR mc_skin_color__cache[30] +#define MENU_INACTIVE_COLOR mc_skin_color__cache[31] +#define MENU_FRAME_COLOR mc_skin_color__cache[32] /* Popup menu colors */ -#define PMENU_ENTRY_COLOR mc_skin_color__cache[31] -#define PMENU_SELECTED_COLOR mc_skin_color__cache[32] -#define PMENU_HOT_COLOR mc_skin_color__cache[33] // unused: not implemented yet -#define PMENU_HOTSEL_COLOR mc_skin_color__cache[34] // unused: not implemented yet -#define PMENU_TITLE_COLOR mc_skin_color__cache[35] -#define PMENU_FRAME_COLOR mc_skin_color__cache[36] +#define PMENU_ENTRY_COLOR mc_skin_color__cache[33] +#define PMENU_SELECTED_COLOR mc_skin_color__cache[34] +#define PMENU_HOT_COLOR mc_skin_color__cache[35] // unused: not implemented yet +#define PMENU_HOTSEL_COLOR mc_skin_color__cache[36] // unused: not implemented yet +#define PMENU_TITLE_COLOR mc_skin_color__cache[37] +#define PMENU_FRAME_COLOR mc_skin_color__cache[38] -#define BUTTONBAR_HOTKEY_COLOR mc_skin_color__cache[37] -#define BUTTONBAR_BUTTON_COLOR mc_skin_color__cache[38] +#define BUTTONBAR_HOTKEY_COLOR mc_skin_color__cache[39] +#define BUTTONBAR_BUTTON_COLOR mc_skin_color__cache[40] -#define STATUSBAR_COLOR mc_skin_color__cache[39] +#define STATUSBAR_COLOR mc_skin_color__cache[41] /* * This should be selectable independently. Default has to be black background * foreground does not matter at all. */ -#define CORE_GAUGE_COLOR mc_skin_color__cache[40] -#define CORE_INPUT_COLOR mc_skin_color__cache[41] -#define CORE_INPUT_UNCHANGED_COLOR mc_skin_color__cache[42] -#define CORE_INPUT_MARK_COLOR mc_skin_color__cache[43] -#define CORE_INPUT_HISTORY_COLOR mc_skin_color__cache[44] -#define CORE_COMMAND_HISTORY_COLOR mc_skin_color__cache[45] - -#define HELP_NORMAL_COLOR mc_skin_color__cache[46] -#define HELP_ITALIC_COLOR mc_skin_color__cache[47] -#define HELP_BOLD_COLOR mc_skin_color__cache[48] -#define HELP_LINK_COLOR mc_skin_color__cache[49] -#define HELP_SLINK_COLOR mc_skin_color__cache[50] -#define HELP_TITLE_COLOR mc_skin_color__cache[51] -#define HELP_FRAME_COLOR mc_skin_color__cache[52] - -#define VIEWER_NORMAL_COLOR mc_skin_color__cache[53] -#define VIEWER_BOLD_COLOR mc_skin_color__cache[54] -#define VIEWER_UNDERLINED_COLOR mc_skin_color__cache[55] -#define VIEWER_BOLD_UNDERLINED_COLOR mc_skin_color__cache[56] -#define VIEWER_SELECTED_COLOR mc_skin_color__cache[57] -#define VIEWER_FRAME_COLOR mc_skin_color__cache[58] +#define CORE_GAUGE_COLOR mc_skin_color__cache[42] +#define CORE_INPUT_COLOR mc_skin_color__cache[43] +#define CORE_INPUT_UNCHANGED_COLOR mc_skin_color__cache[44] +#define CORE_INPUT_MARK_COLOR mc_skin_color__cache[45] +#define CORE_INPUT_HISTORY_COLOR mc_skin_color__cache[46] +#define CORE_COMMAND_HISTORY_COLOR mc_skin_color__cache[47] + +#define HELP_NORMAL_COLOR mc_skin_color__cache[48] +#define HELP_ITALIC_COLOR mc_skin_color__cache[49] +#define HELP_BOLD_COLOR mc_skin_color__cache[50] +#define HELP_LINK_COLOR mc_skin_color__cache[51] +#define HELP_SLINK_COLOR mc_skin_color__cache[52] +#define HELP_TITLE_COLOR mc_skin_color__cache[53] +#define HELP_FRAME_COLOR mc_skin_color__cache[54] + +#define VIEWER_NORMAL_COLOR mc_skin_color__cache[55] +#define VIEWER_BOLD_COLOR mc_skin_color__cache[56] +#define VIEWER_UNDERLINED_COLOR mc_skin_color__cache[57] +#define VIEWER_BOLD_UNDERLINED_COLOR mc_skin_color__cache[58] +#define VIEWER_SELECTED_COLOR mc_skin_color__cache[59] +#define VIEWER_FRAME_COLOR mc_skin_color__cache[60] /* * editor colors - only 4 for normal, search->found, select, and whitespace * respectively * Last is defined to view color. */ -#define EDITOR_NORMAL_COLOR mc_skin_color__cache[59] -#define EDITOR_NONPRINTABLE_COLOR mc_skin_color__cache[60] -#define EDITOR_BOLD_COLOR mc_skin_color__cache[61] -#define EDITOR_MARKED_COLOR mc_skin_color__cache[62] -#define EDITOR_WHITESPACE_COLOR mc_skin_color__cache[63] -#define EDITOR_RIGHT_MARGIN_COLOR mc_skin_color__cache[64] -#define EDITOR_BACKGROUND_COLOR mc_skin_color__cache[65] -#define EDITOR_FRAME_COLOR mc_skin_color__cache[66] -#define EDITOR_FRAME_ACTIVE_COLOR mc_skin_color__cache[67] -#define EDITOR_FRAME_DRAG_COLOR mc_skin_color__cache[68] +#define EDITOR_NORMAL_COLOR mc_skin_color__cache[61] +#define EDITOR_NONPRINTABLE_COLOR mc_skin_color__cache[62] +#define EDITOR_BOLD_COLOR mc_skin_color__cache[63] +#define EDITOR_MARKED_COLOR mc_skin_color__cache[64] +#define EDITOR_WHITESPACE_COLOR mc_skin_color__cache[65] +#define EDITOR_RIGHT_MARGIN_COLOR mc_skin_color__cache[66] +#define EDITOR_BACKGROUND_COLOR mc_skin_color__cache[67] +#define EDITOR_FRAME_COLOR mc_skin_color__cache[68] +#define EDITOR_FRAME_ACTIVE_COLOR mc_skin_color__cache[69] +#define EDITOR_FRAME_DRAG_COLOR mc_skin_color__cache[70] /* color of left 8 char status per line */ -#define EDITOR_LINE_STATE_COLOR mc_skin_color__cache[69] -#define EDITOR_BOOKMARK_COLOR mc_skin_color__cache[70] -#define EDITOR_BOOKMARK_FOUND_COLOR mc_skin_color__cache[71] +#define EDITOR_LINE_STATE_COLOR mc_skin_color__cache[71] +#define EDITOR_BOOKMARK_COLOR mc_skin_color__cache[72] +#define EDITOR_BOOKMARK_FOUND_COLOR mc_skin_color__cache[73] /* Diff colors */ -#define DIFFVIEWER_ADDED_COLOR mc_skin_color__cache[72] -#define DIFFVIEWER_CHANGEDLINE_COLOR mc_skin_color__cache[73] -#define DIFFVIEWER_CHANGEDNEW_COLOR mc_skin_color__cache[74] -#define DIFFVIEWER_CHANGED_COLOR mc_skin_color__cache[75] -#define DIFFVIEWER_REMOVED_COLOR mc_skin_color__cache[76] -#define DIFFVIEWER_ERROR_COLOR mc_skin_color__cache[77] - -#define MC_SKIN_COLOR_CACHE_COUNT 78 +#define DIFFVIEWER_ADDED_COLOR mc_skin_color__cache[74] +#define DIFFVIEWER_CHANGEDLINE_COLOR mc_skin_color__cache[75] +#define DIFFVIEWER_CHANGEDNEW_COLOR mc_skin_color__cache[76] +#define DIFFVIEWER_CHANGED_COLOR mc_skin_color__cache[77] +#define DIFFVIEWER_REMOVED_COLOR mc_skin_color__cache[78] +#define DIFFVIEWER_ERROR_COLOR mc_skin_color__cache[79] + +#define MC_SKIN_COLOR_CACHE_COUNT 81 /*** enums ***************************************************************************************/ diff --git a/lib/skin/colors.c b/lib/skin/colors.c index f8a50d74d9..1cd6703033 100644 --- a/lib/skin/colors.c +++ b/lib/skin/colors.c @@ -252,6 +252,9 @@ mc_skin_color_cache_init (void) CORE_DISABLED_COLOR = mc_skin_color_get ("core", "disabled"); CORE_REVERSE_COLOR = mc_skin_color_get ("core", "reverse"); CORE_HEADER_COLOR = mc_skin_color_get ("core", "header"); + CORE_HINTBAR_COLOR = mc_skin_color_get ("core", "hintbar"); + CORE_PROMPT_COLOR = mc_skin_color_get ("core", "prompt"); + CORE_COMMAND_COLOR = mc_skin_color_get ("core", "commandline"); CORE_COMMAND_MARK_COLOR = mc_skin_color_get ("core", "commandlinemark"); CORE_SHADOW_COLOR = mc_skin_color_get ("core", "shadow"); CORE_FRAME_COLOR = mc_skin_color_get ("core", "frame"); diff --git a/lib/widget/hline.c b/lib/widget/hline.c index 2d6fa91140..679582f481 100644 --- a/lib/widget/hline.c +++ b/lib/widget/hline.c @@ -100,15 +100,11 @@ hline_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *dat return MSG_HANDLED; case MSG_DRAW: - if (l->transparent) - tty_setcolor (CORE_DEFAULT_COLOR); - else - { - const int *colors; + { + const int *colors; - colors = widget_get_colors (w); - tty_setcolor (colors[DLG_COLOR_FRAME]); - } + colors = widget_get_colors (w); + tty_setcolor (colors[DLG_COLOR_FRAME]); tty_draw_hline (w->rect.y, w->rect.x + 1, mc_tty_frm[MC_TTY_FRM_HORIZ], w->rect.cols - 2); @@ -129,6 +125,7 @@ hline_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *dat tty_print_string (l->text); } return MSG_HANDLED; + } case MSG_DESTROY: g_free (l->text); @@ -156,7 +153,6 @@ hline_new (int y, int x, int width) widget_init (w, &r, hline_callback, NULL); l->text = NULL; l->auto_adjust_cols = (width < 0); - l->transparent = FALSE; return l; } diff --git a/lib/widget/hline.h b/lib/widget/hline.h index 94b5f0bd3d..9c66bd3b0a 100644 --- a/lib/widget/hline.h +++ b/lib/widget/hline.h @@ -19,7 +19,6 @@ typedef struct Widget widget; char *text; gboolean auto_adjust_cols; // Compute widget.cols from parent width? - gboolean transparent; // Paint in the default color fg/bg } WHLine; /*** global variables defined in .c file *********************************************************/ diff --git a/lib/widget/input.c b/lib/widget/input.c index bf5d55cbff..1127cce1fc 100644 --- a/lib/widget/input.c +++ b/lib/widget/input.c @@ -944,7 +944,7 @@ input_mouse_callback (Widget *w, mouse_msg_t msg, mouse_event_t *event) /** Create new instance of WInput object. * @param y Y coordinate * @param x X coordinate - * @param input_colors Array of used colors + * @param colors Array of used colors * @param width Widget width * @param def_text Default text filled in widget * @param histname Name of history diff --git a/lib/widget/input.h b/lib/widget/input.h index 81b25040c8..4194024a29 100644 --- a/lib/widget/input.h +++ b/lib/widget/input.h @@ -78,7 +78,7 @@ extern int quote; extern const global_keymap_t *input_map; -/* Color styles for normal and command line input widgets */ +/* Color styles for input widgets */ extern input_colors_t input_colors; /*** declarations of public functions ************************************************************/ diff --git a/lib/widget/label.c b/lib/widget/label.c index 0b5aaa395c..31d376686a 100644 --- a/lib/widget/label.c +++ b/lib/widget/label.c @@ -48,6 +48,11 @@ /*** global variables ****************************************************************************/ +/* Color styles for label widgets */ +label_colors_t label_colors; +label_colors_t hintbar_colors; +label_colors_t prompt_colors; + /*** file scope macro definitions ****************************************************************/ /*** file scope type declarations ****************************************************************/ @@ -78,16 +83,7 @@ label_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *dat return MSG_HANDLED; disabled = widget_get_state (w, WST_DISABLED); - - if (l->transparent) - tty_setcolor (disabled ? CORE_DISABLED_COLOR : CORE_DEFAULT_COLOR); - else - { - const int *colors; - - colors = widget_get_colors (w); - tty_setcolor (disabled ? CORE_DISABLED_COLOR : colors[DLG_COLOR_NORMAL]); - } + tty_setcolor (l->color[disabled ? LABEL_COLOR_DISABLED : LABEL_COLOR_MAIN]); align = (w->pos_flags & WPOS_CENTER_HORZ) != 0 ? J_CENTER_LEFT : J_LEFT; @@ -145,13 +141,35 @@ label_new (int y, int x, const char *text) l->text = g_strdup (text); l->auto_adjust_cols = TRUE; - l->transparent = FALSE; + + // Most of the labels use these colors, so don't take it as a parameter to the constructor. + // Instead have a separate call to replace these colors when needed. + l->color = label_colors; return l; } /* --------------------------------------------------------------------------------------------- */ +/** + * Set default colors for labels. + */ + +void +label_set_default_colors (void) +{ + label_colors[LABEL_COLOR_MAIN] = DIALOG_NORMAL_COLOR; + label_colors[LABEL_COLOR_DISABLED] = CORE_DISABLED_COLOR; + + hintbar_colors[LABEL_COLOR_MAIN] = CORE_HINTBAR_COLOR; + hintbar_colors[LABEL_COLOR_DISABLED] = CORE_DISABLED_COLOR; // unused + + prompt_colors[LABEL_COLOR_MAIN] = CORE_PROMPT_COLOR; + prompt_colors[LABEL_COLOR_DISABLED] = CORE_DISABLED_COLOR; // unused +} + +/* --------------------------------------------------------------------------------------------- */ + void label_set_text (WLabel *label, const char *text) { diff --git a/lib/widget/label.h b/lib/widget/label.h index c3ff995fc3..3c8c728e50 100644 --- a/lib/widget/label.h +++ b/lib/widget/label.h @@ -6,11 +6,20 @@ #ifndef MC__WIDGET_LABEL_H #define MC__WIDGET_LABEL_H +/*** enums ***************************************************************************************/ + +typedef enum +{ + LABEL_COLOR_MAIN, + LABEL_COLOR_DISABLED, + LABEL_COLOR_COUNT +} label_colors_enum_t; + /*** typedefs(not structures) and defined constants **********************************************/ #define LABEL(x) ((WLabel *) (x)) -/*** enums ***************************************************************************************/ +typedef int label_colors_t[LABEL_COLOR_COUNT]; /*** structures declarations (and typedefs of structures)*****************************************/ @@ -19,14 +28,20 @@ typedef struct Widget widget; gboolean auto_adjust_cols; // compute widget.cols from strlen(text)? char *text; - gboolean transparent; // Paint in the default color fg/bg + const int *color; } WLabel; /*** global variables defined in .c file *********************************************************/ +/* Color styles for label widgets */ +extern label_colors_t label_colors; +extern label_colors_t hintbar_colors; +extern label_colors_t prompt_colors; + /*** declarations of public functions ************************************************************/ WLabel *label_new (int y, int x, const char *text); +void label_set_default_colors (void); void label_set_text (WLabel *label, const char *text); void label_set_textv (WLabel *label, const char *format, ...) G_GNUC_PRINTF (2, 3); diff --git a/misc/skins/README.txt b/misc/skins/README.txt index d1f0462e59..863e88bd88 100644 --- a/misc/skins/README.txt +++ b/misc/skins/README.txt @@ -70,6 +70,15 @@ applies individually to each of these three properties. disabled Disabled UI elements, e.g. in Find File and some Options dialogs + hintbar + Usage hint message + + prompt + Shell prompt + + commandline + Command line + commandlinemark Selected text in command line diff --git a/misc/skins/dark.ini b/misc/skins/dark.ini index b70ed5d404..2b9934f396 100644 --- a/misc/skins/dark.ini +++ b/misc/skins/dark.ini @@ -35,6 +35,9 @@ inputmark = cyan;black disabled = gray;blue reverse = black;lightgray + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = black;lightgray header = yellow;black inputhistory = diff --git a/misc/skins/darkfar.ini b/misc/skins/darkfar.ini index 9e87f8bbf9..c3418d7142 100644 --- a/misc/skins/darkfar.ini +++ b/misc/skins/darkfar.ini @@ -35,6 +35,9 @@ inputmark = cyan;black disabled = gray;blue reverse = black;lightgray + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = black;lightgray header = yellow;black inputhistory = diff --git a/misc/skins/default.ini b/misc/skins/default.ini index 635c46916d..d01c7b7ee5 100644 --- a/misc/skins/default.ini +++ b/misc/skins/default.ini @@ -35,6 +35,9 @@ inputmark = cyan;black disabled = gray;lightgray reverse = black;lightgray + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = black;lightgray header = yellow;blue inputhistory = diff --git a/misc/skins/double-lines.ini b/misc/skins/double-lines.ini index 4705584ed2..f6c0b430d0 100644 --- a/misc/skins/double-lines.ini +++ b/misc/skins/double-lines.ini @@ -33,6 +33,9 @@ input = black;cyan inputunchanged = gray;cyan inputmark = cyan;black + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = black;lightgray disabled = gray;lightgray reverse = black;lightgray diff --git a/misc/skins/featured-plus.ini b/misc/skins/featured-plus.ini index 520c751f85..26cda4064d 100644 --- a/misc/skins/featured-plus.ini +++ b/misc/skins/featured-plus.ini @@ -35,6 +35,9 @@ inputmark = cyan;black disabled = gray;lightgray reverse = black;lightgray + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = black;lightgray header = yellow;blue inputhistory = diff --git a/misc/skins/featured.ini b/misc/skins/featured.ini index 25a3f13ed5..bed5d9619b 100644 --- a/misc/skins/featured.ini +++ b/misc/skins/featured.ini @@ -35,6 +35,9 @@ inputmark = cyan;black disabled = gray;lightgray reverse = black;lightgray + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = black;lightgray header = yellow;blue inputhistory = diff --git a/misc/skins/gray-green-purple256.ini b/misc/skins/gray-green-purple256.ini index a07e42069b..bef9fb2566 100644 --- a/misc/skins/gray-green-purple256.ini +++ b/misc/skins/gray-green-purple256.ini @@ -43,6 +43,9 @@ inputmark = ;main1 disabled = gray8;bgdarker reverse = + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = ;main1 header = main2 shadow = rgb000;gray12 diff --git a/misc/skins/gray-orange-blue256.ini b/misc/skins/gray-orange-blue256.ini index 38f4bc8c58..7e103ad513 100644 --- a/misc/skins/gray-orange-blue256.ini +++ b/misc/skins/gray-orange-blue256.ini @@ -43,6 +43,9 @@ inputmark = ;main1 disabled = gray8;bgdarker reverse = + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = ;main1 header = main2 shadow = rgb000;gray12 diff --git a/misc/skins/julia256.ini b/misc/skins/julia256.ini index c41b65cc23..118f122b92 100644 --- a/misc/skins/julia256.ini +++ b/misc/skins/julia256.ini @@ -38,6 +38,9 @@ inputmark = cyan;color237 disabled = gray;lightgray reverse = black;lightgray + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = black;lightgray header = yellow;color237 inputhistory = diff --git a/misc/skins/julia256root.ini b/misc/skins/julia256root.ini index 15141d5b61..9a95734051 100644 --- a/misc/skins/julia256root.ini +++ b/misc/skins/julia256root.ini @@ -38,6 +38,9 @@ inputmark = cyan;color94 disabled = gray;lightgray reverse = black;lightgray + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = black;lightgray header = color214;color237 inputhistory = diff --git a/misc/skins/mc46.ini b/misc/skins/mc46.ini index d76089d17d..ac1f1c545d 100644 --- a/misc/skins/mc46.ini +++ b/misc/skins/mc46.ini @@ -35,6 +35,9 @@ inputmark = cyan;black disabled = gray;lightgray reverse = black;lightgray + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = black;lightgray header = yellow;blue inputhistory = diff --git a/misc/skins/modarcon16-defbg-thin.ini b/misc/skins/modarcon16-defbg-thin.ini index 1a54c9a002..b89abb28d8 100644 --- a/misc/skins/modarcon16-defbg-thin.ini +++ b/misc/skins/modarcon16-defbg-thin.ini @@ -75,6 +75,9 @@ input = color15;color0 inputmark = color11;color2;bold inputunchanged = ;color0 + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = color11;color2;bold reverse = color0;color10 header = color3 diff --git a/misc/skins/modarcon16-defbg.ini b/misc/skins/modarcon16-defbg.ini index d21ee6142b..187dc82acf 100644 --- a/misc/skins/modarcon16-defbg.ini +++ b/misc/skins/modarcon16-defbg.ini @@ -75,6 +75,9 @@ input = color15;color0 inputmark = color11;color2;bold inputunchanged = ;color0 + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = color11;color2;bold reverse = color0;color10 header = color3 diff --git a/misc/skins/modarcon16-thin.ini b/misc/skins/modarcon16-thin.ini index 5eb93e084d..eb0d39efbd 100644 --- a/misc/skins/modarcon16-thin.ini +++ b/misc/skins/modarcon16-thin.ini @@ -75,6 +75,9 @@ input = color15 inputmark = color11;color2;bold inputunchanged = + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = color11;color2;bold reverse = color0;color10 header = color3 diff --git a/misc/skins/modarcon16.ini b/misc/skins/modarcon16.ini index 782d5f9299..aa7f86e849 100644 --- a/misc/skins/modarcon16.ini +++ b/misc/skins/modarcon16.ini @@ -75,6 +75,9 @@ input = color15 inputmark = color11;color2;bold inputunchanged = + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = color11;color2;bold reverse = color0;color10 header = color3 diff --git a/misc/skins/modarcon16root-defbg-thin.ini b/misc/skins/modarcon16root-defbg-thin.ini index 3ad88af4f7..e01d518ad0 100644 --- a/misc/skins/modarcon16root-defbg-thin.ini +++ b/misc/skins/modarcon16root-defbg-thin.ini @@ -75,6 +75,9 @@ input = color15;color0 inputmark = color11;color1;bold inputunchanged = ;color0 + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = color11;color1;bold reverse = color0;color9 header = color3 diff --git a/misc/skins/modarcon16root-defbg.ini b/misc/skins/modarcon16root-defbg.ini index 4fc5eb88a8..16bb62f8aa 100644 --- a/misc/skins/modarcon16root-defbg.ini +++ b/misc/skins/modarcon16root-defbg.ini @@ -75,6 +75,9 @@ input = color15;color0 inputmark = color11;color1;bold inputunchanged = ;color0 + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = color11;color1;bold reverse = color0;color9 header = color3 diff --git a/misc/skins/modarcon16root-thin.ini b/misc/skins/modarcon16root-thin.ini index 1eabe8af9d..f0f9271755 100644 --- a/misc/skins/modarcon16root-thin.ini +++ b/misc/skins/modarcon16root-thin.ini @@ -75,6 +75,9 @@ input = color15 inputmark = color11;color1;bold inputunchanged = + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = color11;color1;bold reverse = color0;color9 header = color3 diff --git a/misc/skins/modarcon16root.ini b/misc/skins/modarcon16root.ini index a588a67481..02249f45a5 100644 --- a/misc/skins/modarcon16root.ini +++ b/misc/skins/modarcon16root.ini @@ -75,6 +75,9 @@ input = color15 inputmark = color11;color1;bold inputunchanged = + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = color11;color1;bold reverse = color0;color9 header = color3 diff --git a/misc/skins/modarin256-defbg-thin.ini b/misc/skins/modarin256-defbg-thin.ini index 4e9d787764..52403b679b 100644 --- a/misc/skins/modarin256-defbg-thin.ini +++ b/misc/skins/modarin256-defbg-thin.ini @@ -75,6 +75,9 @@ input = color187;color235;bold inputmark = color228;color23;bold inputunchanged = color144;color235;bold + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = color228;color23;bold reverse = color254;color66 header = color180;;bold diff --git a/misc/skins/modarin256-defbg.ini b/misc/skins/modarin256-defbg.ini index 2cfd414316..ef5c94a64d 100644 --- a/misc/skins/modarin256-defbg.ini +++ b/misc/skins/modarin256-defbg.ini @@ -75,6 +75,9 @@ input = color187;color235;bold inputmark = color228;color23;bold inputunchanged = color144;color235;bold + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = color228;color23;bold reverse = color254;color66 header = color180;;bold diff --git a/misc/skins/modarin256-thin.ini b/misc/skins/modarin256-thin.ini index 3729276d63..323003cf09 100644 --- a/misc/skins/modarin256-thin.ini +++ b/misc/skins/modarin256-thin.ini @@ -75,6 +75,9 @@ input = color187;color235;bold inputmark = color228;color23;bold inputunchanged = color144;color235;bold + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = color228;color23;bold reverse = color254;color66 header = color180;;bold diff --git a/misc/skins/modarin256.ini b/misc/skins/modarin256.ini index 69394706c3..1101092f1c 100644 --- a/misc/skins/modarin256.ini +++ b/misc/skins/modarin256.ini @@ -75,6 +75,9 @@ input = color187;color235;bold inputmark = color228;color23;bold inputunchanged = color144;color235;bold + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = color228;color23;bold reverse = color254;color66 header = color180;;bold diff --git a/misc/skins/modarin256root-defbg-thin.ini b/misc/skins/modarin256root-defbg-thin.ini index 9f745df53c..d1d6189d72 100644 --- a/misc/skins/modarin256root-defbg-thin.ini +++ b/misc/skins/modarin256root-defbg-thin.ini @@ -75,6 +75,9 @@ input = color187;color235;bold inputmark = color228;color88;bold inputunchanged = color144;color235;bold + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = color228;color88;bold reverse = color254;color95 header = color180;;bold diff --git a/misc/skins/modarin256root-defbg.ini b/misc/skins/modarin256root-defbg.ini index f06b4c557c..5f9e94991c 100644 --- a/misc/skins/modarin256root-defbg.ini +++ b/misc/skins/modarin256root-defbg.ini @@ -75,6 +75,9 @@ input = color187;color235;bold inputmark = color228;color88;bold inputunchanged = color144;color235;bold + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = color228;color88;bold reverse = color254;color95 header = color180;;bold diff --git a/misc/skins/modarin256root-thin.ini b/misc/skins/modarin256root-thin.ini index 66c71b169a..ffb5a9374d 100644 --- a/misc/skins/modarin256root-thin.ini +++ b/misc/skins/modarin256root-thin.ini @@ -75,6 +75,9 @@ input = color187;color235;bold inputmark = color228;color88;bold inputunchanged = color144;color235;bold + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = color228;color88;bold reverse = color254;color95 header = color180;;bold diff --git a/misc/skins/modarin256root.ini b/misc/skins/modarin256root.ini index 3ffdd5c8be..f9b7d82789 100644 --- a/misc/skins/modarin256root.ini +++ b/misc/skins/modarin256root.ini @@ -75,6 +75,9 @@ input = color187;color235;bold inputmark = color228;color88;bold inputunchanged = color144;color235;bold + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = color228;color88;bold reverse = color254;color95 header = color180;;bold diff --git a/misc/skins/nicedark.ini b/misc/skins/nicedark.ini index 0f18c5aab9..87e665b560 100644 --- a/misc/skins/nicedark.ini +++ b/misc/skins/nicedark.ini @@ -35,6 +35,9 @@ inputmark = black;lightgray disabled = gray;black reverse = brown;black + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = black;lightgray header = lightgray;black inputhistory = diff --git a/misc/skins/sand256.ini b/misc/skins/sand256.ini index 0930ace00a..d93ea5e871 100644 --- a/misc/skins/sand256.ini +++ b/misc/skins/sand256.ini @@ -36,6 +36,9 @@ inputmark = rgb452;gray disabled = gray;rgb553 reverse = ;rgb452 + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = white;gray header = red;;italic shadow = black;rgb221 diff --git a/misc/skins/seasons-autumn16M.ini b/misc/skins/seasons-autumn16M.ini index 2a16be8b24..17568e896e 100644 --- a/misc/skins/seasons-autumn16M.ini +++ b/misc/skins/seasons-autumn16M.ini @@ -80,6 +80,9 @@ inputmark = #000;DialogFocus disabled = PaleFg;Dialog reverse = #000;Bottom + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = #000;DialogFocus header = HeaderFg shadow = ShadowFg;ShadowBg diff --git a/misc/skins/seasons-spring16M.ini b/misc/skins/seasons-spring16M.ini index 236652ea8b..1de834e6c8 100644 --- a/misc/skins/seasons-spring16M.ini +++ b/misc/skins/seasons-spring16M.ini @@ -80,6 +80,9 @@ inputmark = #000;DialogFocus disabled = PaleFg;Dialog reverse = #000;Bottom + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = #000;DialogFocus header = HeaderFg shadow = ShadowFg;ShadowBg diff --git a/misc/skins/seasons-summer16M.ini b/misc/skins/seasons-summer16M.ini index 3b0a23841c..40bf12903c 100644 --- a/misc/skins/seasons-summer16M.ini +++ b/misc/skins/seasons-summer16M.ini @@ -80,6 +80,9 @@ inputmark = #000;DialogFocus disabled = PaleFg;Dialog reverse = #000;Bottom + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = #000;DialogFocus header = HeaderFg shadow = ShadowFg;ShadowBg diff --git a/misc/skins/seasons-winter16M.ini b/misc/skins/seasons-winter16M.ini index 9bd234aa4f..f74050036c 100644 --- a/misc/skins/seasons-winter16M.ini +++ b/misc/skins/seasons-winter16M.ini @@ -80,6 +80,9 @@ inputmark = #000;DialogFocus disabled = PaleFg;Dialog reverse = #000;Bottom + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = #000;DialogFocus header = HeaderFg shadow = ShadowFg;ShadowBg diff --git a/misc/skins/xoria256-thin.ini b/misc/skins/xoria256-thin.ini index 6808c3971f..59efebcb37 100644 --- a/misc/skins/xoria256-thin.ini +++ b/misc/skins/xoria256-thin.ini @@ -53,6 +53,9 @@ #inputhistory = #commandhistory = + hintbar = default;default + prompt = default;default + commandline = default;default #commandlinemark = black;lightgray shadow = color239;black diff --git a/misc/skins/xoria256.ini b/misc/skins/xoria256.ini index fab80ed6ac..538fdc9ff5 100644 --- a/misc/skins/xoria256.ini +++ b/misc/skins/xoria256.ini @@ -53,6 +53,9 @@ #inputhistory = #commandhistory = + hintbar = default;default + prompt = default;default + commandline = default;default #commandlinemark = black;lightgray shadow = color239;black diff --git a/misc/skins/xoria256root-thin.ini b/misc/skins/xoria256root-thin.ini index fedd67b9de..f39050c7df 100644 --- a/misc/skins/xoria256root-thin.ini +++ b/misc/skins/xoria256root-thin.ini @@ -53,6 +53,9 @@ #inputhistory = #commandhistory = + hintbar = default;default + prompt = default;default + commandline = default;default #commandlinemark = black;lightgray shadow = color239;black diff --git a/misc/skins/yadt256-defbg.ini b/misc/skins/yadt256-defbg.ini index 01b4cd7fdf..161f3974d7 100644 --- a/misc/skins/yadt256-defbg.ini +++ b/misc/skins/yadt256-defbg.ini @@ -42,6 +42,9 @@ input = color187;color235;bold inputmark = color228;blue;bold inputunchanged = color144;color235;bold + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = color228;blue;bold reverse = color180;blue;bold header = color180;;bold diff --git a/misc/skins/yadt256.ini b/misc/skins/yadt256.ini index 0d99e4a2c5..03d4b3535f 100644 --- a/misc/skins/yadt256.ini +++ b/misc/skins/yadt256.ini @@ -41,6 +41,9 @@ input = color187;color235;bold inputmark = color228;blue;bold inputunchanged = color144;color235;bold + hintbar = default;default + prompt = default;default + commandline = default;default commandlinemark = color228;blue;bold reverse = color180;blue;bold header = color180;;bold diff --git a/src/filemanager/boxes.c b/src/filemanager/boxes.c index 9327a531bf..25a4a4845e 100644 --- a/src/filemanager/boxes.c +++ b/src/filemanager/boxes.c @@ -155,6 +155,7 @@ skin_apply (const gchar *skin_override) mc_skin_init (skin_override, &mcerror); mc_fhl_free (&mc_filehighlight); mc_filehighlight = mc_fhl_new (TRUE); + label_set_default_colors (); dlg_set_default_colors (); input_set_default_colors (); if (mc_global.mc_run_mode == MC_RUN_FULL) diff --git a/src/filemanager/command.c b/src/filemanager/command.c index 812646f7fa..d7c6a2799c 100644 --- a/src/filemanager/command.c +++ b/src/filemanager/command.c @@ -229,9 +229,9 @@ command_new (int y, int x, int cols) void command_set_default_colors (void) { - command_colors[INPUT_COLOR_MAIN] = CORE_DEFAULT_COLOR; + command_colors[INPUT_COLOR_MAIN] = CORE_COMMAND_COLOR; command_colors[INPUT_COLOR_MARK] = CORE_COMMAND_MARK_COLOR; - command_colors[INPUT_COLOR_UNCHANGED] = CORE_DEFAULT_COLOR; + command_colors[INPUT_COLOR_UNCHANGED] = CORE_COMMAND_COLOR; command_colors[INPUT_COLOR_HISTORY] = CORE_COMMAND_HISTORY_COLOR; } diff --git a/src/filemanager/filemanager.c b/src/filemanager/filemanager.c index 6882f06f57..50e405d830 100644 --- a/src/filemanager/filemanager.c +++ b/src/filemanager/filemanager.c @@ -886,7 +886,7 @@ create_file_manager (void) group_add_widget (g, get_panel_widget (1)); the_hint = label_new (0, 0, NULL); - the_hint->transparent = TRUE; + the_hint->color = hintbar_colors; the_hint->auto_adjust_cols = 0; WIDGET (the_hint)->rect.cols = COLS; group_add_widget (g, the_hint); @@ -895,7 +895,7 @@ create_file_manager (void) group_add_widget (g, cmdline); the_prompt = label_new (0, 0, mc_prompt); - the_prompt->transparent = TRUE; + the_prompt->color = prompt_colors; group_add_widget (g, the_prompt); the_bar = buttonbar_new (); diff --git a/src/main.c b/src/main.c index ce12c3cbee..c3b01c07f1 100644 --- a/src/main.c +++ b/src/main.c @@ -367,6 +367,7 @@ main (int argc, char *argv[]) tty_init_colors (mc_global.tty.disable_colors, mc_args__force_colors); mc_skin_init (NULL, &mcerror); + label_set_default_colors (); dlg_set_default_colors (); input_set_default_colors (); if (mc_global.mc_run_mode == MC_RUN_FULL) From e996d14efdb5a05b3b842556b3fca0eea3490642 Mon Sep 17 00:00:00 2001 From: Egmont Koblinger Date: Wed, 28 Jan 2026 13:30:33 +0100 Subject: [PATCH 3/5] Ticket #4974: Use buttonbar hotkey color for unused areas of buttonbar This only affects windows narrower than 70 columns. With this change, there are no more characters on the skin that aren't skinnable and are necessarily of the terminal's default colors. Signed-off-by: Egmont Koblinger --- lib/widget/buttonbar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widget/buttonbar.c b/lib/widget/buttonbar.c index f0f9b3edfa..da42f5383e 100644 --- a/lib/widget/buttonbar.c +++ b/lib/widget/buttonbar.c @@ -180,7 +180,7 @@ buttonbar_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void { buttonbar_init_button_positions (bb); widget_gotoyx (w, 0, 0); - tty_setcolor (CORE_DEFAULT_COLOR); + tty_setcolor (BUTTONBAR_HOTKEY_COLOR); tty_printf ("%-*s", w->rect.cols, ""); widget_gotoyx (w, 0, 0); From b0bb2c42f48c1b9309f91ed44e0daae494b3a206 Mon Sep 17 00:00:00 2001 From: Egmont Koblinger Date: Wed, 28 Jan 2026 13:33:04 +0100 Subject: [PATCH 4/5] Ticket #4950, #4951: Remove "base" color and "terminal_default_color" role Remove support for the "base" color value which was presumably never used. Remove support for the "[skin]" section's "terminal_default_color" keyword which did not work and whose intent was unclear. Remove the no longer used and misleadingly named internal variable CORE_DEFAULT_COLOR. Signed-off-by: Egmont Koblinger --- doc/man/mc.1.in | 6 +++--- lib/skin.h | 3 +-- lib/skin/colors.c | 7 ++----- lib/tty/color.c | 38 +++----------------------------------- lib/tty/color.h | 2 -- src/filemanager/command.c | 4 ++-- 6 files changed, 11 insertions(+), 49 deletions(-) diff --git a/doc/man/mc.1.in b/doc/man/mc.1.in index a5f5358f05..269cd0e424 100644 --- a/doc/man/mc.1.in +++ b/doc/man/mc.1.in @@ -3650,9 +3650,9 @@ is used for popup menu title. The possible colors are: black, gray, red, brightred, green, brightgreen, brown, yellow, blue, brightblue, magenta, brightmagenta, cyan, brightcyan, lightgray and white; as well as "default" for the terminal's -default foreground or background color. Another special keyword "base" means mc's main -colors. When 256 colors are available, they can be specified either as -color16 to color255, or as rgb000 to rgb555 and gray0 to gray23. Example: +default foreground or background color. When 256 colors are available, they +can be specified either as color16 to color255, or as rgb000 to rgb555 and +gray0 to gray23. Example: .PP .nf [Colors] diff --git a/lib/skin.h b/lib/skin.h index 504bfd70c4..1dfabe537f 100644 --- a/lib/skin.h +++ b/lib/skin.h @@ -13,7 +13,6 @@ See color-slang.h (A_*) */ /* cache often used colors */ -#define CORE_DEFAULT_COLOR mc_skin_color__cache[80] // removed in the second next commit #define CORE_NORMAL_COLOR mc_skin_color__cache[0] #define CORE_MARKED_COLOR mc_skin_color__cache[1] #define CORE_SELECTED_COLOR mc_skin_color__cache[2] @@ -121,7 +120,7 @@ #define DIFFVIEWER_REMOVED_COLOR mc_skin_color__cache[78] #define DIFFVIEWER_ERROR_COLOR mc_skin_color__cache[79] -#define MC_SKIN_COLOR_CACHE_COUNT 81 +#define MC_SKIN_COLOR_CACHE_COUNT 80 /*** enums ***************************************************************************************/ diff --git a/lib/skin/colors.c b/lib/skin/colors.c index 1cd6703033..72e429af31 100644 --- a/lib/skin/colors.c +++ b/lib/skin/colors.c @@ -224,7 +224,7 @@ mc_skin_color_get_from_ini_file (mc_skin_t *mc_skin, const gchar *group, const g /* --------------------------------------------------------------------------------------------- */ static void -mc_skin_color_set_default_for_terminal (mc_skin_t *mc_skin) +mc_skin_color_set_default_for_terminal (void) { tty_color_pair_t *mc_skin_color; @@ -235,7 +235,6 @@ mc_skin_color_set_default_for_terminal (mc_skin_t *mc_skin) mc_skin_color->bg = g_strdup ("default"); mc_skin_color->attrs = NULL; mc_skin_color->pair_index = tty_try_alloc_color_pair (mc_skin_color, FALSE); - mc_skin_color_add_to_hash (mc_skin, "skin", "terminal_default_color", mc_skin_color); } } @@ -244,7 +243,6 @@ mc_skin_color_set_default_for_terminal (mc_skin_t *mc_skin) static void mc_skin_color_cache_init (void) { - CORE_DEFAULT_COLOR = mc_skin_color_get ("skin", "terminal_default_color"); CORE_NORMAL_COLOR = mc_skin_color_get ("core", "_default_"); CORE_MARKED_COLOR = mc_skin_color_get ("core", "marked"); CORE_SELECTED_COLOR = mc_skin_color_get ("core", "selected"); @@ -386,12 +384,11 @@ mc_skin_color_parse_ini_file (mc_skin_t *mc_skin) goto ret; // as first, need to set up default colors - mc_skin_color_set_default_for_terminal (mc_skin); + mc_skin_color_set_default_for_terminal (); mc_skin_color = mc_skin_color_get_from_ini_file (mc_skin, "core", "_default_"); if (mc_skin_color == NULL) goto ret; - tty_color_set_defaults (mc_skin_color); mc_skin_color_add_to_hash (mc_skin, "core", "_default_", mc_skin_color); for (groups = orig_groups; *groups != NULL; groups++) diff --git a/lib/tty/color.c b/lib/tty/color.c index 512659b411..1df0f017a6 100644 --- a/lib/tty/color.c +++ b/lib/tty/color.c @@ -46,10 +46,6 @@ /*** global variables ****************************************************************************/ -static tty_color_pair_t tty_color_defaults = { - .fg = NULL, .bg = NULL, .attrs = NULL, .pair_index = 0 -}; - /* Set if we are actually using colors */ gboolean use_colors = FALSE; @@ -69,16 +65,6 @@ static GHashTable *mc_tty_color__hashtable = NULL; /*** file scope functions ************************************************************************/ /* --------------------------------------------------------------------------------------------- */ -static void -mc_color__deinit (tty_color_pair_t *color) -{ - g_free (color->fg); - g_free (color->bg); - g_free (color->attrs); -} - -/* --------------------------------------------------------------------------------------------- */ - static gboolean tty_color_free_temp_cb (gpointer key, gpointer value, gpointer user_data) { @@ -135,7 +121,6 @@ void tty_colors_done (void) { tty_color_deinit_lib (); - mc_color__deinit (&tty_color_defaults); g_hash_table_destroy (mc_tty_color__hashtable); } @@ -152,17 +137,13 @@ tty_use_colors (void) int tty_try_alloc_color_pair (const tty_color_pair_t *color, gboolean is_temp) { - gboolean is_base; gchar *color_pair; tty_color_lib_pair_t *mc_color_pair; int ifg, ibg, attr; - is_base = (color->fg == NULL || strcmp (color->fg, "base") == 0); - ifg = tty_color_get_index_by_name (is_base ? tty_color_defaults.fg : color->fg); - is_base = (color->bg == NULL || strcmp (color->bg, "base") == 0); - ibg = tty_color_get_index_by_name (is_base ? tty_color_defaults.bg : color->bg); - is_base = (color->attrs == NULL || strcmp (color->attrs, "base") == 0); - attr = tty_attr_get_bits (is_base ? tty_color_defaults.attrs : color->attrs); + ifg = tty_color_get_index_by_name (color->fg); + ibg = tty_color_get_index_by_name (color->bg); + attr = tty_attr_get_bits (color->attrs); color_pair = g_strdup_printf ("%d.%d.%d", ifg, ibg, attr); if (color_pair == NULL) @@ -223,16 +204,3 @@ tty_color_free_all (void) } /* --------------------------------------------------------------------------------------------- */ - -void -tty_color_set_defaults (const tty_color_pair_t *color) -{ - mc_color__deinit (&tty_color_defaults); - - tty_color_defaults.fg = g_strdup (color->fg); - tty_color_defaults.bg = g_strdup (color->bg); - tty_color_defaults.attrs = g_strdup (color->attrs); - tty_color_defaults.pair_index = 0; -} - -/* --------------------------------------------------------------------------------------------- */ diff --git a/lib/tty/color.h b/lib/tty/color.h index df97d22368..de5eba0df3 100644 --- a/lib/tty/color.h +++ b/lib/tty/color.h @@ -50,8 +50,6 @@ void tty_setcolor (int color); void tty_lowlevel_setcolor (int color); void tty_set_normal_attrs (void); -void tty_color_set_defaults (const tty_color_pair_t *color); - extern gboolean tty_use_256colors (GError **error); extern gboolean tty_use_truecolors (GError **error); diff --git a/src/filemanager/command.c b/src/filemanager/command.c index d7c6a2799c..cfa4dbdf5c 100644 --- a/src/filemanager/command.c +++ b/src/filemanager/command.c @@ -38,8 +38,8 @@ #include "lib/global.h" #include "lib/vfs/vfs.h" // vfs_current_is_local() -#include "lib/skin.h" // CORE_DEFAULT_COLOR -#include "lib/util.h" // whitespace() +#include "lib/skin.h" +#include "lib/util.h" // whitespace() #include "lib/widget.h" #include "src/setup.h" // quit From a79a9de4920c62582eeaafbd461c760e08555142 Mon Sep 17 00:00:00 2001 From: Egmont Koblinger Date: Wed, 28 Jan 2026 13:38:07 +0100 Subject: [PATCH 5/5] Rename CORE_NORMAL_COLOR to CORE_DEFAULT_COLOR This is what the previously wrongly named CORE_DEFAULT_COLOR, retired in the previous commit, should have always stood for. Signed-off-by: Egmont Koblinger --- lib/filehighlight/get-color.c | 4 ++-- lib/skin.h | 2 +- lib/skin/colors.c | 2 +- src/diffviewer/ydiff.c | 4 ++-- src/filemanager/filemanager.c | 2 +- src/filemanager/info.c | 6 +++--- src/filemanager/layout.c | 2 +- src/filemanager/panel.c | 24 ++++++++++++------------ src/filemanager/tree.c | 10 +++++----- src/viewer/display.c | 2 +- 10 files changed, 29 insertions(+), 29 deletions(-) diff --git a/lib/filehighlight/get-color.c b/lib/filehighlight/get-color.c index ea07be643e..092c50c91b 100644 --- a/lib/filehighlight/get-color.c +++ b/lib/filehighlight/get-color.c @@ -282,7 +282,7 @@ mc_fhl_get_color (const mc_fhl_t *fhl, const file_entry_t *fe) int ret; if (fhl == NULL) - return CORE_NORMAL_COLOR; + return CORE_DEFAULT_COLOR; for (i = 0; i < fhl->filters->len; i++) { @@ -306,7 +306,7 @@ mc_fhl_get_color (const mc_fhl_t *fhl, const file_entry_t *fe) break; } } - return CORE_NORMAL_COLOR; + return CORE_DEFAULT_COLOR; } /* --------------------------------------------------------------------------------------------- */ diff --git a/lib/skin.h b/lib/skin.h index 1dfabe537f..b406c104ef 100644 --- a/lib/skin.h +++ b/lib/skin.h @@ -13,7 +13,7 @@ See color-slang.h (A_*) */ /* cache often used colors */ -#define CORE_NORMAL_COLOR mc_skin_color__cache[0] +#define CORE_DEFAULT_COLOR mc_skin_color__cache[0] #define CORE_MARKED_COLOR mc_skin_color__cache[1] #define CORE_SELECTED_COLOR mc_skin_color__cache[2] #define CORE_MARKED_SELECTED_COLOR mc_skin_color__cache[3] diff --git a/lib/skin/colors.c b/lib/skin/colors.c index 72e429af31..d3611e4be3 100644 --- a/lib/skin/colors.c +++ b/lib/skin/colors.c @@ -243,7 +243,7 @@ mc_skin_color_set_default_for_terminal (void) static void mc_skin_color_cache_init (void) { - CORE_NORMAL_COLOR = mc_skin_color_get ("core", "_default_"); + CORE_DEFAULT_COLOR = mc_skin_color_get ("core", "_default_"); CORE_MARKED_COLOR = mc_skin_color_get ("core", "marked"); CORE_SELECTED_COLOR = mc_skin_color_get ("core", "selected"); CORE_MARKED_SELECTED_COLOR = mc_skin_color_get ("core", "markselect"); diff --git a/src/diffviewer/ydiff.c b/src/diffviewer/ydiff.c index 53bf9894ed..87bf4ce270 100644 --- a/src/diffviewer/ydiff.c +++ b/src/diffviewer/ydiff.c @@ -2526,7 +2526,7 @@ dview_display_file (const WDiff *dview, diff_place_t ord, int r, int c, int heig p = (DIFFLN *) &g_array_index (dview->a[ord], DIFFLN, i); ch = p->ch; - tty_setcolor (CORE_NORMAL_COLOR); + tty_setcolor (CORE_DEFAULT_COLOR); if (display_symbols) { tty_gotoyx (r + j, c - 2); @@ -2653,7 +2653,7 @@ dview_display_file (const WDiff *dview, diff_place_t ord, int r, int c, int heig } } - tty_setcolor (CORE_NORMAL_COLOR); + tty_setcolor (CORE_DEFAULT_COLOR); k = width; if (width < xwidth - 1) k = xwidth - 1; diff --git a/src/filemanager/filemanager.c b/src/filemanager/filemanager.c index 50e405d830..44ab7901f9 100644 --- a/src/filemanager/filemanager.c +++ b/src/filemanager/filemanager.c @@ -525,7 +525,7 @@ print_vfs_message (const gchar *event_group_name, const gchar *event_name, gpoin tty_getyx (&row, &col); tty_gotoyx (0, 0); - tty_setcolor (CORE_NORMAL_COLOR); + tty_setcolor (CORE_DEFAULT_COLOR); tty_print_string (str_fit_to_term (event_data->msg, COLS - 1, J_LEFT)); // Restore cursor position diff --git a/src/filemanager/info.c b/src/filemanager/info.c index bc984d5f4d..8c2ca09bd6 100644 --- a/src/filemanager/info.c +++ b/src/filemanager/info.c @@ -87,7 +87,7 @@ info_box (WInfo *info) const int len = str_term_width1 (title); tty_set_normal_attrs (); - tty_setcolor (CORE_NORMAL_COLOR); + tty_setcolor (CORE_DEFAULT_COLOR); widget_erase (w); tty_setcolor (CORE_FRAME_COLOR); @@ -98,7 +98,7 @@ info_box (WInfo *info) tty_print_char (mc_tty_frm[MC_TTY_FRM_DRIGHTMIDDLE]); tty_draw_hline (w->rect.y + 2, w->rect.x + 1, mc_tty_frm[MC_TTY_FRM_HORIZ], w->rect.cols - 2); - tty_setcolor (CORE_NORMAL_COLOR); + tty_setcolor (CORE_DEFAULT_COLOR); widget_gotoyx (w, 0, (w->rect.cols - len - 2) / 2); tty_printf (" %s ", title); } @@ -154,7 +154,7 @@ info_show_info (WInfo *info) i18n_adjust = str_term_width1 (file_label) + 2; } - tty_setcolor (CORE_NORMAL_COLOR); + tty_setcolor (CORE_DEFAULT_COLOR); buff = g_string_new (""); diff --git a/src/filemanager/layout.c b/src/filemanager/layout.c index ff2c9fdad8..59c0bea181 100644 --- a/src/filemanager/layout.c +++ b/src/filemanager/layout.c @@ -1043,7 +1043,7 @@ rotate_dash (gboolean show) return; widget_gotoyx (w, menubar_visible ? 1 : 0, w->rect.cols - 1); - tty_setcolor (CORE_NORMAL_COLOR); + tty_setcolor (CORE_DEFAULT_COLOR); if (!show) tty_print_char (mc_tty_frm[MC_TTY_FRM_DRIGHTTOP]); diff --git a/src/filemanager/panel.c b/src/filemanager/panel.c index 922a5c2013..0fe526a78c 100644 --- a/src/filemanager/panel.c +++ b/src/filemanager/panel.c @@ -277,7 +277,7 @@ set_colors (const WPanel *panel) (void) panel; tty_set_normal_attrs (); - tty_setcolor (CORE_NORMAL_COLOR); + tty_setcolor (CORE_DEFAULT_COLOR); } /* --------------------------------------------------------------------------------------------- */ @@ -660,11 +660,11 @@ file_compute_color (const file_attr_t attr, file_entry_t *fe) case FATTR_MARKED_CURRENT: return (CORE_MARKED_SELECTED_COLOR); case FATTR_STATUS: - return (CORE_NORMAL_COLOR); + return (CORE_DEFAULT_COLOR); case FATTR_NORMAL: default: if (!panels_options.filetype_mode) - return (CORE_NORMAL_COLOR); + return (CORE_DEFAULT_COLOR); } return mc_fhl_get_color (mc_filehighlight, fe); @@ -686,7 +686,7 @@ static filename_scroll_flag_t format_file (WPanel *panel, int file_index, int width, file_attr_t attr, gboolean isstatus, int *field_length) { - int color = CORE_NORMAL_COLOR; + int color = CORE_DEFAULT_COLOR; int length = 0; GSList *format, *home; file_entry_t *fe = NULL; @@ -851,12 +851,12 @@ repaint_file (WPanel *panel, int file_index, file_attr_t attr) const int file_color = attr == FATTR_CURRENT || attr == FATTR_MARKED_CURRENT ? CORE_SELECTED_COLOR - : CORE_NORMAL_COLOR; + : CORE_DEFAULT_COLOR; if ((ret_frm & FILENAME_SCROLL_LEFT) != 0) { const int scroll_left_char_color = - panel->list_format == list_long ? file_color : CORE_NORMAL_COLOR; + panel->list_format == list_long ? file_color : CORE_DEFAULT_COLOR; widget_gotoyx (w, ypos, offset); tty_setcolor (scroll_left_char_color); @@ -870,7 +870,7 @@ repaint_file (WPanel *panel, int file_index, file_attr_t attr) const int scroll_right_char_color = panel->list_format != list_long && g_slist_length (panel->format) > 2 ? file_color - : CORE_NORMAL_COLOR; + : CORE_DEFAULT_COLOR; widget_gotoyx (w, ypos, offset); tty_setcolor (scroll_right_char_color); @@ -1043,7 +1043,7 @@ mini_info_separator (const WPanel *panel) y = panel_lines (panel) + 2; - tty_setcolor (CORE_NORMAL_COLOR); + tty_setcolor (CORE_DEFAULT_COLOR); /* Status displays total marked size. * Centered in panel, full format. */ display_total_marked_size (panel, y, -1, FALSE); @@ -1092,7 +1092,7 @@ show_free_space (const WPanel *panel) ? 0 : (int) (100 * (long double) myfs_stats.avail / myfs_stats.total)); widget_gotoyx (w, w->rect.lines - 1, w->rect.cols - 2 - (int) strlen (tmp)); - tty_setcolor (CORE_NORMAL_COLOR); + tty_setcolor (CORE_DEFAULT_COLOR); tty_print_string (tmp); } } @@ -1255,7 +1255,7 @@ show_dir (const WPanel *panel) g_free (tmp); - tty_setcolor (CORE_NORMAL_COLOR); + tty_setcolor (CORE_DEFAULT_COLOR); widget_gotoyx (w, 0, 3); if (panel->is_panelized) @@ -1293,7 +1293,7 @@ show_dir (const WPanel *panel) g_snprintf (buffer, sizeof (buffer), " %s ", size_trunc_sep (fe->st.st_size, panels_options.kilobyte_si)); - tty_setcolor (CORE_NORMAL_COLOR); + tty_setcolor (CORE_DEFAULT_COLOR); widget_gotoyx (w, w->rect.lines - 1, 4); tty_print_string (buffer); } @@ -1538,7 +1538,7 @@ panel_print_header (const WPanel *panel) widget_gotoyx (w, 1, 1); tty_getyx (&y, &x); - tty_setcolor (CORE_NORMAL_COLOR); + tty_setcolor (CORE_DEFAULT_COLOR); tty_draw_hline (y, x, ' ', w->rect.cols - 2); format_txt = g_string_new (""); diff --git a/src/filemanager/tree.c b/src/filemanager/tree.c index 5fe2e95161..be16ab3fac 100644 --- a/src/filemanager/tree.c +++ b/src/filemanager/tree.c @@ -253,7 +253,7 @@ tree_show_mini_info (WTree *tree, int tree_lines, int tree_cols) const int *colors; colors = widget_get_colors (w); - tty_setcolor (tree->is_panel ? CORE_NORMAL_COLOR : colors[DLG_COLOR_NORMAL]); + tty_setcolor (tree->is_panel ? CORE_DEFAULT_COLOR : colors[DLG_COLOR_NORMAL]); tty_draw_hline (w->rect.y + line, w->rect.x + 1, ' ', tree_cols); widget_gotoyx (w, line, 1); tty_print_string ( @@ -339,7 +339,7 @@ show_tree (WTree *tree) const int *colors; colors = widget_get_colors (w); - tty_setcolor (tree->is_panel ? CORE_NORMAL_COLOR : colors[DLG_COLOR_NORMAL]); + tty_setcolor (tree->is_panel ? CORE_DEFAULT_COLOR : colors[DLG_COLOR_NORMAL]); // Move to the beginning of the line tty_draw_hline (w->rect.y + y + i, w->rect.x + x, ' ', tree_cols); @@ -352,7 +352,7 @@ show_tree (WTree *tree) gboolean selected; selected = widget_get_state (w, WST_FOCUSED) && current == tree->selected_ptr; - tty_setcolor (selected ? CORE_SELECTED_COLOR : CORE_NORMAL_COLOR); + tty_setcolor (selected ? CORE_SELECTED_COLOR : CORE_DEFAULT_COLOR); } else { @@ -1111,7 +1111,7 @@ tree_frame (WDialog *h, WTree *tree) (void) h; - tty_setcolor (CORE_NORMAL_COLOR); + tty_setcolor (CORE_DEFAULT_COLOR); widget_erase (w); if (tree->is_panel) { @@ -1136,7 +1136,7 @@ tree_frame (WDialog *h, WTree *tree) const gboolean focused = widget_get_state (w, WST_FOCUSED); - tty_setcolor (focused ? CORE_REVERSE_COLOR : CORE_NORMAL_COLOR); + tty_setcolor (focused ? CORE_REVERSE_COLOR : CORE_DEFAULT_COLOR); widget_gotoyx (w, 0, (w->rect.cols - len - 2) / 2); tty_printf (" %s ", title); } diff --git a/src/viewer/display.c b/src/viewer/display.c index f33b612529..4b32b84c94 100644 --- a/src/viewer/display.c +++ b/src/viewer/display.c @@ -347,7 +347,7 @@ mcview_display_frame (const WView *view) const gboolean focused = widget_get_state (w, WST_FOCUSED); const char *title = _ ("Quick view"); - tty_setcolor (focused ? CORE_REVERSE_COLOR : CORE_NORMAL_COLOR); + tty_setcolor (focused ? CORE_REVERSE_COLOR : CORE_DEFAULT_COLOR); widget_gotoyx (w, 0, (r->cols - str_term_width1 (title) - 2) / 2); tty_printf (" %s ", title); }