diff --git a/lib/widget/input.c b/lib/widget/input.c
index 14d87ea..3ae9679 100644
a
|
b
|
int quote = 0; |
60 | 60 | |
61 | 61 | const global_keymap_t *input_map = NULL; |
62 | 62 | |
| 63 | /* Color styles for normal and command line input widgets */ |
| 64 | input_colors_t input_colors; |
| 65 | input_colors_t command_colors; |
| 66 | |
63 | 67 | /*** file scope macro definitions ****************************************************************/ |
64 | 68 | |
65 | 69 | #define LARGE_HISTORY_BUTTON 1 |
… |
… |
input_set_options_callback (Widget * w, widget_options_t options, gboolean enabl |
989 | 993 | * @return WInput object |
990 | 994 | */ |
991 | 995 | WInput * |
992 | | input_new (int y, int x, const int *input_colors, int width, const char *def_text, |
| 996 | input_new (int y, int x, const int *colors, int width, const char *def_text, |
993 | 997 | const char *histname, input_complete_t completion_flags) |
994 | 998 | { |
995 | 999 | WInput *in; |
… |
… |
input_new (int y, int x, const int *input_colors, int width, const char *def_tex |
1001 | 1005 | w->options |= W_IS_INPUT; |
1002 | 1006 | w->set_options = input_set_options_callback; |
1003 | 1007 | |
1004 | | memmove (in->color, input_colors, sizeof (input_colors_t)); |
1005 | | |
| 1008 | in->color = colors; |
1006 | 1009 | in->first = TRUE; |
1007 | 1010 | in->highlight = FALSE; |
1008 | 1011 | in->term_first_shown = 0; |
… |
… |
input_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d |
1110 | 1113 | |
1111 | 1114 | /* --------------------------------------------------------------------------------------------- */ |
1112 | 1115 | |
1113 | | /** Get default colors for WInput widget. |
1114 | | * @return default colors |
1115 | | */ |
1116 | | const int * |
1117 | | input_get_default_colors (void) |
| 1116 | void |
| 1117 | input_set_default_colors (void) |
1118 | 1118 | { |
1119 | | static input_colors_t standart_colors; |
1120 | | |
1121 | | standart_colors[WINPUTC_MAIN] = INPUT_COLOR; |
1122 | | standart_colors[WINPUTC_MARK] = INPUT_MARK_COLOR; |
1123 | | standart_colors[WINPUTC_UNCHANGED] = INPUT_UNCHANGED_COLOR; |
1124 | | standart_colors[WINPUTC_HISTORY] = INPUT_HISTORY_COLOR; |
1125 | | |
1126 | | return standart_colors; |
| 1119 | input_colors[WINPUTC_MAIN] = INPUT_COLOR; |
| 1120 | input_colors[WINPUTC_MARK] = INPUT_MARK_COLOR; |
| 1121 | input_colors[WINPUTC_UNCHANGED] = INPUT_UNCHANGED_COLOR; |
| 1122 | input_colors[WINPUTC_HISTORY] = INPUT_HISTORY_COLOR; |
| 1123 | |
| 1124 | command_colors[WINPUTC_MAIN] = DEFAULT_COLOR; |
| 1125 | command_colors[WINPUTC_MARK] = COMMAND_MARK_COLOR; |
| 1126 | command_colors[WINPUTC_UNCHANGED] = DEFAULT_COLOR; |
| 1127 | command_colors[WINPUTC_HISTORY] = COMMAND_HISTORY_COLOR; |
1127 | 1128 | } |
1128 | 1129 | |
1129 | 1130 | /* --------------------------------------------------------------------------------------------- */ |
diff --git a/lib/widget/input.h b/lib/widget/input.h
index 65982a5..d79bd45 100644
a
|
b
|
typedef int input_colors_t[WINPUTC_COUNT_COLORS]; |
46 | 46 | typedef struct |
47 | 47 | { |
48 | 48 | Widget widget; |
49 | | input_colors_t color; |
| 49 | const int *color; |
50 | 50 | int point; /* cursor position in the input line in characters */ |
51 | 51 | int mark; /* the mark position in characters */ |
52 | 52 | gboolean highlight; /* there is a selected block */ |
… |
… |
extern int quote; |
79 | 79 | |
80 | 80 | extern const global_keymap_t *input_map; |
81 | 81 | |
| 82 | /* Color styles for normal and command line input widgets */ |
| 83 | extern input_colors_t input_colors; |
| 84 | extern input_colors_t command_colors; |
| 85 | |
82 | 86 | /*** declarations of public functions ************************************************************/ |
83 | 87 | |
84 | | WInput *input_new (int y, int x, const int *input_colors, |
| 88 | WInput *input_new (int y, int x, const int *colors, |
85 | 89 | int len, const char *text, const char *histname, |
86 | 90 | input_complete_t completion_flags); |
87 | 91 | /* callbac is public; needed for command line */ |
88 | 92 | cb_ret_t input_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data); |
89 | | const int *input_get_default_colors (void); |
| 93 | void input_set_default_colors (void); |
90 | 94 | cb_ret_t input_handle_char (WInput * in, int key); |
91 | 95 | int input_key_is_in_map (WInput * in, int key); |
92 | 96 | void input_assign_text (WInput * in, const char *text); |
diff --git a/lib/widget/quick.c b/lib/widget/quick.c
index c4aceed..a4b4ec4 100644
a
|
b
|
quick_create_input (int y, int x, const quick_widget_t * qw) |
70 | 70 | { |
71 | 71 | WInput *in; |
72 | 72 | |
73 | | in = input_new (y, x, input_get_default_colors (), 8, qw->u.input.text, qw->u.input.histname, |
| 73 | in = input_new (y, x, input_colors, 8, qw->u.input.text, qw->u.input.histname, |
74 | 74 | qw->u.input.completion_flags); |
75 | 75 | |
76 | 76 | in->is_password = qw->u.input.is_passwd; |
diff --git a/src/editor/editcmd_dialogs.c b/src/editor/editcmd_dialogs.c
index c66787b..84039f2 100644
a
|
b
|
editcmd_dialog_raw_key_query (const char *heading, const char *query, gboolean c |
323 | 323 | NULL, NULL, heading, DLG_CENTER | DLG_TRYUP | DLG_WANT_TAB); |
324 | 324 | |
325 | 325 | add_widget (raw_dlg, label_new (y, 3, query)); |
326 | | add_widget (raw_dlg, input_new (y++, 3 + wq + 1, input_get_default_colors (), |
| 326 | add_widget (raw_dlg, input_new (y++, 3 + wq + 1, input_colors, |
327 | 327 | w - (6 + wq + 1), "", 0, INPUT_COMPLETE_NONE)); |
328 | 328 | if (cancel) |
329 | 329 | { |
diff --git a/src/filemanager/boxes.c b/src/filemanager/boxes.c
index 026f5b3..042fe8b 100644
a
|
b
|
skin_apply (const gchar * skin_override) |
528 | 528 | mc_fhl_free (&mc_filehighlight); |
529 | 529 | mc_filehighlight = mc_fhl_new (TRUE); |
530 | 530 | dlg_set_default_colors (); |
| 531 | input_set_default_colors (); |
531 | 532 | panel_deinit (); |
532 | 533 | panel_init (); |
533 | 534 | repaint_screen (); |
diff --git a/src/filemanager/command.c b/src/filemanager/command.c
index 5b06921..7fde0a9 100644
a
|
b
|
WInput * |
463 | 463 | command_new (int y, int x, int cols) |
464 | 464 | { |
465 | 465 | WInput *cmd; |
466 | | const input_colors_t command_colors = { |
467 | | DEFAULT_COLOR, |
468 | | COMMAND_MARK_COLOR, |
469 | | DEFAULT_COLOR, |
470 | | COMMAND_HISTORY_COLOR |
471 | | }; |
472 | | |
473 | | cmd = input_new (y, x, (int *) command_colors, cols, "", "cmdline", |
| 466 | |
| 467 | cmd = input_new (y, x, command_colors, cols, "", "cmdline", |
474 | 468 | INPUT_COMPLETE_FILENAMES | INPUT_COMPLETE_VARIABLES | INPUT_COMPLETE_USERNAMES |
475 | 469 | | INPUT_COMPLETE_HOSTNAMES | INPUT_COMPLETE_CD | INPUT_COMPLETE_COMMANDS | |
476 | 470 | INPUT_COMPLETE_SHELL_ESC); |
diff --git a/src/filemanager/find.c b/src/filemanager/find.c
index 76134cf..e457ded 100644
a
|
b
|
find_parameters (char **start_dir, ssize_t * start_dir_len, |
615 | 615 | |
616 | 616 | add_widget (find_dlg, label_new (y1++, x1, _("Start at:"))); |
617 | 617 | in_start = |
618 | | input_new (y1, x1, input_get_default_colors (), cols - b0 - 7, in_start_dir, "start", |
| 618 | input_new (y1, x1, input_colors, cols - b0 - 7, in_start_dir, "start", |
619 | 619 | INPUT_COMPLETE_CD | INPUT_COMPLETE_FILENAMES); |
620 | 620 | add_widget (find_dlg, in_start); |
621 | 621 | |
… |
… |
find_parameters (char **start_dir, ssize_t * start_dir_len, |
626 | 626 | add_widget (find_dlg, ignore_dirs_cbox); |
627 | 627 | |
628 | 628 | in_ignore = |
629 | | input_new (y1++, x1, input_get_default_colors (), cols - 6, |
| 629 | input_new (y1++, x1, input_colors, cols - 6, |
630 | 630 | options.ignore_dirs != NULL ? options.ignore_dirs : "", "ignoredirs", |
631 | 631 | INPUT_COMPLETE_CD | INPUT_COMPLETE_FILENAMES); |
632 | 632 | widget_disable (WIDGET (in_ignore), !options.ignore_dirs_enable); |
… |
… |
find_parameters (char **start_dir, ssize_t * start_dir_len, |
639 | 639 | /* Start 1st column */ |
640 | 640 | add_widget (find_dlg, label_new (y1++, x1, file_name_label)); |
641 | 641 | in_name = |
642 | | input_new (y1++, x1, input_get_default_colors (), cw, INPUT_LAST_TEXT, "name", |
| 642 | input_new (y1++, x1, input_colors, cw, INPUT_LAST_TEXT, "name", |
643 | 643 | INPUT_COMPLETE_FILENAMES | INPUT_COMPLETE_CD); |
644 | 644 | add_widget (find_dlg, in_name); |
645 | 645 | |
… |
… |
find_parameters (char **start_dir, ssize_t * start_dir_len, |
647 | 647 | content_label = label_new (y2++, x2, content_content_label); |
648 | 648 | add_widget (find_dlg, content_label); |
649 | 649 | in_with = |
650 | | input_new (y2++, x2, input_get_default_colors (), cw, INPUT_LAST_TEXT, |
| 650 | input_new (y2++, x2, input_colors, cw, INPUT_LAST_TEXT, |
651 | 651 | MC_HISTORY_SHARED_SEARCH, INPUT_COMPLETE_NONE); |
652 | 652 | in_with->label = content_label; |
653 | 653 | widget_disable (WIDGET (in_with), disable); |
diff --git a/src/filemanager/panelize.c b/src/filemanager/panelize.c
index 7d0c360..45e2519 100644
a
|
b
|
init_panelize (void) |
186 | 186 | y += WIDGET (l_panelize)->lines + 1; |
187 | 187 | add_widget (panelize_dlg, label_new (y++, UX, _("Command"))); |
188 | 188 | pname = |
189 | | input_new (y++, UX, input_get_default_colors (), panelize_cols - UX * 2, "", "in", |
| 189 | input_new (y++, UX, input_colors, panelize_cols - UX * 2, "", "in", |
190 | 190 | INPUT_COMPLETE_FILENAMES | INPUT_COMPLETE_HOSTNAMES | INPUT_COMPLETE_COMMANDS | |
191 | 191 | INPUT_COMPLETE_VARIABLES | INPUT_COMPLETE_USERNAMES | INPUT_COMPLETE_CD | |
192 | 192 | INPUT_COMPLETE_SHELL_ESC); |
diff --git a/src/main.c b/src/main.c
index dc340bb..28bddd2 100644
a
|
b
|
main (int argc, char *argv[]) |
372 | 372 | |
373 | 373 | mc_skin_init (NULL, &error); |
374 | 374 | dlg_set_default_colors (); |
| 375 | input_set_default_colors (); |
375 | 376 | if (error != NULL) |
376 | 377 | { |
377 | 378 | message (D_ERROR, _("Warning"), "%s", error->message); |