mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
Ticket #2171: colors for popup menu:
... for menu items, selected menu item and for menu title. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
f8207591bd
commit
380d9bd885
@ -3429,6 +3429,7 @@ dhotnormal, dhotfocus, dtitle. Error dialog colors are: errdfocus, errdhotnormal
|
|||||||
errdhotfocus, errdtitle. Help colors are: helpnormal, helpitalic, helpbold,
|
errdhotfocus, errdtitle. Help colors are: helpnormal, helpitalic, helpbold,
|
||||||
helplink, helpslink, helptitle. Viewer color are: viewbold, viewunderline, viewselected.
|
helplink, helpslink, helptitle. Viewer color are: viewbold, viewunderline, viewselected.
|
||||||
Editor colors are: editnormal, editbold, editmarked, editwhitespace, editlinestate.
|
Editor colors are: editnormal, editbold, editmarked, editwhitespace, editlinestate.
|
||||||
|
Popup menu colors are: pmenunormal, pmenusel, pmenutitle.
|
||||||
.PP
|
.PP
|
||||||
.I input
|
.I input
|
||||||
determines the color of input lines used in query dialogs.
|
determines the color of input lines used in query dialogs.
|
||||||
@ -3468,6 +3469,14 @@ is used for not selected hyperlinks and
|
|||||||
.I helpslink
|
.I helpslink
|
||||||
is used for selected hyperlink.
|
is used for selected hyperlink.
|
||||||
.PP
|
.PP
|
||||||
|
Popup menu uses following colors:
|
||||||
|
.I pmenunormal
|
||||||
|
is used for non-selected menu items and as a main color of popup menu window,
|
||||||
|
.I pmenusel
|
||||||
|
is used for selected menu item,
|
||||||
|
.I pmenutitle
|
||||||
|
is used for popup menu title.
|
||||||
|
.PP
|
||||||
The possible colors are: black, gray, red, brightred, green,
|
The possible colors are: black, gray, red, brightred, green,
|
||||||
brightgreen, brown, yellow, blue, brightblue, magenta, brightmagenta,
|
brightgreen, brown, yellow, blue, brightblue, magenta, brightmagenta,
|
||||||
cyan, brightcyan, lightgray and white. And there is a special keyword
|
cyan, brightcyan, lightgray and white. And there is a special keyword
|
||||||
|
@ -3690,6 +3690,7 @@ errdfocus, errdhotnormal, errdhotfocus, errdtitle. Цвета в окне вст
|
|||||||
помощи: helpnormal, helpitalic, helpbold, helplink, helpslink. Цвета в окне
|
помощи: helpnormal, helpitalic, helpbold, helplink, helpslink. Цвета в окне
|
||||||
программы просмотра: viewbold, viewunderline, viewselected. Цвета в редакторе:
|
программы просмотра: viewbold, viewunderline, viewselected. Цвета в редакторе:
|
||||||
editnormal, editbold, editmarked, editwhitespace, editlinestate.
|
editnormal, editbold, editmarked, editwhitespace, editlinestate.
|
||||||
|
Цвета окна всплывающего меню: pmenunormal, pmenusel, pmenutitle.
|
||||||
.PP
|
.PP
|
||||||
Цвета задавать не обязательно. Цвет какого именно поля определяется
|
Цвета задавать не обязательно. Цвет какого именно поля определяется
|
||||||
каждым ключевым словом, можно понять из перевода этого ключевого слова.
|
каждым ключевым словом, можно понять из перевода этого ключевого слова.
|
||||||
@ -3743,6 +3744,14 @@ editnormal, editbold, editmarked, editwhitespace, editlinestate.
|
|||||||
.I helpslink
|
.I helpslink
|
||||||
\- для выделения активной в данный момент гиперссылки.
|
\- для выделения активной в данный момент гиперссылки.
|
||||||
.PP
|
.PP
|
||||||
|
Во всплывающем меню используются следующие цвета:
|
||||||
|
.I pmenunormal
|
||||||
|
\- для невыбранных пунктов меню и как основной цвет окна,
|
||||||
|
.I pmenusel
|
||||||
|
\- для выбранного пункта меню,
|
||||||
|
.I pmenutitle
|
||||||
|
\- для заголовка окна меню.
|
||||||
|
.PP
|
||||||
Возможные цвета: black, gray, red, brightred, green, brightgreen, brown,
|
Возможные цвета: black, gray, red, brightred, green, brightgreen, brown,
|
||||||
yellow, blue, brightblue, magenta, brightmagenta, cyan, brightcyan,
|
yellow, blue, brightblue, magenta, brightmagenta, cyan, brightcyan,
|
||||||
lightgray и white.
|
lightgray и white.
|
||||||
|
75
lib/skin.h
75
lib/skin.h
@ -44,59 +44,66 @@
|
|||||||
#define MENU_HOTSEL_COLOR mc_skin_color__cache[22]
|
#define MENU_HOTSEL_COLOR mc_skin_color__cache[22]
|
||||||
#define MENU_INACTIVE_COLOR mc_skin_color__cache[23]
|
#define MENU_INACTIVE_COLOR mc_skin_color__cache[23]
|
||||||
|
|
||||||
#define BUTTONBAR_HOTKEY_COLOR mc_skin_color__cache[24]
|
/* Popup menu colors */
|
||||||
#define BUTTONBAR_BUTTON_COLOR mc_skin_color__cache[25]
|
#define PMENU_ENTRY_COLOR mc_skin_color__cache[24]
|
||||||
|
#define PMENU_SELECTED_COLOR mc_skin_color__cache[25]
|
||||||
|
#define PMENU_HOT_COLOR mc_skin_color__cache[26] /* unused: not implemented yet */
|
||||||
|
#define PMENU_HOTSEL_COLOR mc_skin_color__cache[27] /* unused: not implemented yet */
|
||||||
|
#define PMENU_TITLE_COLOR mc_skin_color__cache[28]
|
||||||
|
|
||||||
#define STATUSBAR_COLOR mc_skin_color__cache[26]
|
#define BUTTONBAR_HOTKEY_COLOR mc_skin_color__cache[29]
|
||||||
|
#define BUTTONBAR_BUTTON_COLOR mc_skin_color__cache[30]
|
||||||
|
|
||||||
|
#define STATUSBAR_COLOR mc_skin_color__cache[31]
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This should be selectable independently. Default has to be black background
|
* This should be selectable independently. Default has to be black background
|
||||||
* foreground does not matter at all.
|
* foreground does not matter at all.
|
||||||
*/
|
*/
|
||||||
#define GAUGE_COLOR mc_skin_color__cache[27]
|
#define GAUGE_COLOR mc_skin_color__cache[32]
|
||||||
#define INPUT_COLOR mc_skin_color__cache[28]
|
#define INPUT_COLOR mc_skin_color__cache[33]
|
||||||
#define INPUT_UNCHANGED_COLOR mc_skin_color__cache[29]
|
#define INPUT_UNCHANGED_COLOR mc_skin_color__cache[34]
|
||||||
#define INPUT_MARK_COLOR mc_skin_color__cache[30]
|
#define INPUT_MARK_COLOR mc_skin_color__cache[35]
|
||||||
#define INPUT_HISTORY_COLOR mc_skin_color__cache[31]
|
#define INPUT_HISTORY_COLOR mc_skin_color__cache[36]
|
||||||
#define COMMAND_HISTORY_COLOR mc_skin_color__cache[32]
|
#define COMMAND_HISTORY_COLOR mc_skin_color__cache[37]
|
||||||
|
|
||||||
#define HELP_NORMAL_COLOR mc_skin_color__cache[33]
|
#define HELP_NORMAL_COLOR mc_skin_color__cache[38]
|
||||||
#define HELP_ITALIC_COLOR mc_skin_color__cache[34]
|
#define HELP_ITALIC_COLOR mc_skin_color__cache[39]
|
||||||
#define HELP_BOLD_COLOR mc_skin_color__cache[35]
|
#define HELP_BOLD_COLOR mc_skin_color__cache[40]
|
||||||
#define HELP_LINK_COLOR mc_skin_color__cache[36]
|
#define HELP_LINK_COLOR mc_skin_color__cache[41]
|
||||||
#define HELP_SLINK_COLOR mc_skin_color__cache[37]
|
#define HELP_SLINK_COLOR mc_skin_color__cache[42]
|
||||||
#define HELP_TITLE_COLOR mc_skin_color__cache[38]
|
#define HELP_TITLE_COLOR mc_skin_color__cache[43]
|
||||||
|
|
||||||
|
|
||||||
#define VIEW_BOLD_COLOR mc_skin_color__cache[39]
|
#define VIEW_BOLD_COLOR mc_skin_color__cache[44]
|
||||||
#define VIEW_UNDERLINED_COLOR mc_skin_color__cache[40]
|
#define VIEW_UNDERLINED_COLOR mc_skin_color__cache[45]
|
||||||
#define VIEW_SELECTED_COLOR mc_skin_color__cache[41]
|
#define VIEW_SELECTED_COLOR mc_skin_color__cache[46]
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* editor colors - only 4 for normal, search->found, select, and whitespace
|
* editor colors - only 4 for normal, search->found, select, and whitespace
|
||||||
* respectively
|
* respectively
|
||||||
* Last is defined to view color.
|
* Last is defined to view color.
|
||||||
*/
|
*/
|
||||||
#define EDITOR_NORMAL_COLOR mc_skin_color__cache[42]
|
#define EDITOR_NORMAL_COLOR mc_skin_color__cache[47]
|
||||||
#define EDITOR_BOLD_COLOR mc_skin_color__cache[43]
|
#define EDITOR_BOLD_COLOR mc_skin_color__cache[48]
|
||||||
#define EDITOR_MARKED_COLOR mc_skin_color__cache[44]
|
#define EDITOR_MARKED_COLOR mc_skin_color__cache[49]
|
||||||
#define EDITOR_WHITESPACE_COLOR mc_skin_color__cache[45]
|
#define EDITOR_WHITESPACE_COLOR mc_skin_color__cache[50]
|
||||||
#define EDITOR_RIGHT_MARGIN_COLOR mc_skin_color__cache[46]
|
#define EDITOR_RIGHT_MARGIN_COLOR mc_skin_color__cache[51]
|
||||||
/* color of left 8 char status per line */
|
/* color of left 8 char status per line */
|
||||||
#define LINE_STATE_COLOR mc_skin_color__cache[47]
|
#define LINE_STATE_COLOR mc_skin_color__cache[52]
|
||||||
#define BOOK_MARK_COLOR mc_skin_color__cache[48]
|
#define BOOK_MARK_COLOR mc_skin_color__cache[53]
|
||||||
#define BOOK_MARK_FOUND_COLOR mc_skin_color__cache[49]
|
#define BOOK_MARK_FOUND_COLOR mc_skin_color__cache[54]
|
||||||
|
|
||||||
/* Diff colors */
|
/* Diff colors */
|
||||||
#define DFF_ADD_COLOR mc_skin_color__cache[50]
|
#define DFF_ADD_COLOR mc_skin_color__cache[55]
|
||||||
#define DFF_CHG_COLOR mc_skin_color__cache[51]
|
#define DFF_CHG_COLOR mc_skin_color__cache[56]
|
||||||
#define DFF_CHH_COLOR mc_skin_color__cache[52]
|
#define DFF_CHH_COLOR mc_skin_color__cache[57]
|
||||||
#define DFF_CHD_COLOR mc_skin_color__cache[53]
|
#define DFF_CHD_COLOR mc_skin_color__cache[58]
|
||||||
#define DFF_DEL_COLOR mc_skin_color__cache[54]
|
#define DFF_DEL_COLOR mc_skin_color__cache[59]
|
||||||
#define DFF_FOLDER_COLOR mc_skin_color__cache[55]
|
#define DFF_FOLDER_COLOR mc_skin_color__cache[60]
|
||||||
#define DFF_ERROR_COLOR mc_skin_color__cache[56]
|
#define DFF_ERROR_COLOR mc_skin_color__cache[61]
|
||||||
|
|
||||||
#define MC_SKIN_COLOR_CACHE_COUNT 57
|
#define MC_SKIN_COLOR_CACHE_COUNT 62
|
||||||
|
|
||||||
/*** enums ***************************************************************************************/
|
/*** enums ***************************************************************************************/
|
||||||
|
|
||||||
|
@ -69,6 +69,9 @@ static const mc_skin_colors_old_t old_colors[] = {
|
|||||||
{"menusel", "menu", "menusel"},
|
{"menusel", "menu", "menusel"},
|
||||||
{"menuhotsel", "menu", "menuhotsel"},
|
{"menuhotsel", "menu", "menuhotsel"},
|
||||||
{"menuinactive", "menu", "menuinactive"},
|
{"menuinactive", "menu", "menuinactive"},
|
||||||
|
{"pmenunormal", "popupmenu", "_default_"},
|
||||||
|
{"pmenusel", "popupmenu", "menusel"},
|
||||||
|
{"pmenutitle", "popupmenu", "menutitle"},
|
||||||
{"bbarhotkey", "buttonbar", "hotkey"},
|
{"bbarhotkey", "buttonbar", "hotkey"},
|
||||||
{"bbarbutton", "buttonbar", "button"},
|
{"bbarbutton", "buttonbar", "button"},
|
||||||
{"statusbar", "statusbar", "_default_"},
|
{"statusbar", "statusbar", "_default_"},
|
||||||
|
@ -227,6 +227,10 @@ mc_skin_color_cache_init (void)
|
|||||||
MENU_HOTSEL_COLOR = mc_skin_color_get ("menu", "menuhotsel");
|
MENU_HOTSEL_COLOR = mc_skin_color_get ("menu", "menuhotsel");
|
||||||
MENU_INACTIVE_COLOR = mc_skin_color_get ("menu", "menuinactive");
|
MENU_INACTIVE_COLOR = mc_skin_color_get ("menu", "menuinactive");
|
||||||
|
|
||||||
|
PMENU_ENTRY_COLOR = mc_skin_color_get ("popupmenu", "_default_");
|
||||||
|
PMENU_SELECTED_COLOR = mc_skin_color_get ("popupmenu", "menusel");
|
||||||
|
PMENU_TITLE_COLOR = mc_skin_color_get ("popupmenu", "menutitle");
|
||||||
|
|
||||||
BUTTONBAR_HOTKEY_COLOR = mc_skin_color_get ("buttonbar", "hotkey");
|
BUTTONBAR_HOTKEY_COLOR = mc_skin_color_get ("buttonbar", "hotkey");
|
||||||
BUTTONBAR_BUTTON_COLOR = mc_skin_color_get ("buttonbar", "button");
|
BUTTONBAR_BUTTON_COLOR = mc_skin_color_get ("buttonbar", "button");
|
||||||
|
|
||||||
|
@ -65,6 +65,9 @@ mc_skin_hardcoded_blackwhite_colors (mc_skin_t * mc_skin)
|
|||||||
mc_config_set_string (mc_skin->config, "menu", "menusel", "default");
|
mc_config_set_string (mc_skin->config, "menu", "menusel", "default");
|
||||||
mc_config_set_string (mc_skin->config, "menu", "menuhotsel", "A_UNDERLINE");
|
mc_config_set_string (mc_skin->config, "menu", "menuhotsel", "A_UNDERLINE");
|
||||||
mc_config_set_string (mc_skin->config, "menu", "menuinactive", "A_REVERSE");
|
mc_config_set_string (mc_skin->config, "menu", "menuinactive", "A_REVERSE");
|
||||||
|
mc_config_set_string (mc_skin->config, "popupmenu", "_default_", "A_REVERSE");
|
||||||
|
mc_config_set_string (mc_skin->config, "popupmenu", "menusel", "default");
|
||||||
|
mc_config_set_string (mc_skin->config, "popupmenu", "menutitle", "A_REVERSE");
|
||||||
mc_config_set_string (mc_skin->config, "statusbar", "_default_", "A_REVERSE");
|
mc_config_set_string (mc_skin->config, "statusbar", "_default_", "A_REVERSE");
|
||||||
mc_config_set_string (mc_skin->config, "help", "_default_", "A_REVERSE");
|
mc_config_set_string (mc_skin->config, "help", "_default_", "A_REVERSE");
|
||||||
mc_config_set_string (mc_skin->config, "help", "helpitalic", "A_REVERSE");
|
mc_config_set_string (mc_skin->config, "help", "helpitalic", "A_REVERSE");
|
||||||
|
@ -57,11 +57,11 @@ create_listbox_window_centered (int center_y, int center_x, int lines, int cols,
|
|||||||
const char *title, const char *help)
|
const char *title, const char *help)
|
||||||
{
|
{
|
||||||
const dlg_colors_t listbox_colors = {
|
const dlg_colors_t listbox_colors = {
|
||||||
MENU_ENTRY_COLOR,
|
PMENU_ENTRY_COLOR,
|
||||||
MENU_SELECTED_COLOR,
|
PMENU_SELECTED_COLOR,
|
||||||
MENU_HOT_COLOR,
|
PMENU_ENTRY_COLOR,
|
||||||
MENU_HOTSEL_COLOR,
|
PMENU_SELECTED_COLOR,
|
||||||
COLOR_TITLE
|
PMENU_TITLE_COLOR
|
||||||
};
|
};
|
||||||
|
|
||||||
const int space = 4;
|
const int space = 4;
|
||||||
|
@ -116,6 +116,11 @@
|
|||||||
[statusbar]
|
[statusbar]
|
||||||
_default_=black;white
|
_default_=black;white
|
||||||
|
|
||||||
|
[popupmenu]
|
||||||
|
_default_=lightgray;blue
|
||||||
|
menusel=black;cyan
|
||||||
|
menutitle=lightgray;blue
|
||||||
|
|
||||||
[widget-common]
|
[widget-common]
|
||||||
sort-sign-up=↑
|
sort-sign-up=↑
|
||||||
sort-sign-down=↓
|
sort-sign-down=↓
|
||||||
|
@ -117,6 +117,11 @@
|
|||||||
folder=blue;black
|
folder=blue;black
|
||||||
error=red;white
|
error=red;white
|
||||||
|
|
||||||
|
[popupmenu]
|
||||||
|
_default_=white;cyan
|
||||||
|
menusel=yellow;black
|
||||||
|
menutitle=yellow;cyan
|
||||||
|
|
||||||
[widget-common]
|
[widget-common]
|
||||||
sort-sign-up = '
|
sort-sign-up = '
|
||||||
sort-sign-down = ,
|
sort-sign-down = ,
|
||||||
|
@ -116,6 +116,11 @@
|
|||||||
folder=blue;black
|
folder=blue;black
|
||||||
error=red;white
|
error=red;white
|
||||||
|
|
||||||
|
[popupmenu]
|
||||||
|
_default_=white;cyan
|
||||||
|
menusel=white;black
|
||||||
|
menutitle=white;cyan
|
||||||
|
|
||||||
[widget-common]
|
[widget-common]
|
||||||
sort-sign-up = '
|
sort-sign-up = '
|
||||||
sort-sign-down = ,
|
sort-sign-down = ,
|
||||||
|
@ -118,6 +118,11 @@
|
|||||||
folder=blue;black
|
folder=blue;black
|
||||||
error=red;white
|
error=red;white
|
||||||
|
|
||||||
|
[popupmenu]
|
||||||
|
_default_=white;cyan
|
||||||
|
menusel=white;black
|
||||||
|
menutitle=white;cyan
|
||||||
|
|
||||||
[widget-common]
|
[widget-common]
|
||||||
sort-sign-up = ↓
|
sort-sign-up = ↓
|
||||||
sort-sign-down = ↑
|
sort-sign-down = ↑
|
||||||
|
@ -113,3 +113,8 @@
|
|||||||
removed=;blue
|
removed=;blue
|
||||||
folder=brightblue;
|
folder=brightblue;
|
||||||
error=white;red
|
error=white;red
|
||||||
|
|
||||||
|
[popupmenu]
|
||||||
|
_default_=brightgreen;black
|
||||||
|
menusel=brightcyan;blue
|
||||||
|
menutitle=brightcyan;black
|
||||||
|
@ -93,6 +93,11 @@
|
|||||||
[viewer]
|
[viewer]
|
||||||
viewunderline=brightred;blue
|
viewunderline=brightred;blue
|
||||||
|
|
||||||
|
[popupmenu]
|
||||||
|
_default_=lightgray;black
|
||||||
|
menusel=lightgray;blue
|
||||||
|
menutitle=lightgray;black
|
||||||
|
|
||||||
[widget-common]
|
[widget-common]
|
||||||
sort-sign-down=↑
|
sort-sign-down=↑
|
||||||
sort-sign-up=↓
|
sort-sign-up=↓
|
||||||
|
22
src/args.c
22
src/args.c
@ -319,15 +319,12 @@ mc_args_clean_temp_help_strings (void)
|
|||||||
static GOptionGroup *
|
static GOptionGroup *
|
||||||
mc_args_new_color_group (void)
|
mc_args_new_color_group (void)
|
||||||
{
|
{
|
||||||
/*
|
/* FIXME: to preserve translations, lines should be split. */
|
||||||
* FIXME: undocumented keywords: viewunderline, editnormal, editbold,
|
mc_args__loc__colors_string = g_strdup_printf ("%s\n%s",
|
||||||
* and editmarked. To preserve translations, lines should be split.
|
/* TRANSLATORS: don't translate keywords */
|
||||||
*/
|
|
||||||
mc_args__loc__colors_string = g_strdup_printf ("%s%s",
|
|
||||||
/* TRANSLATORS: don't translate keywords and names of colors */
|
|
||||||
_("--colors KEYWORD={FORE},{BACK}\n\n"
|
_("--colors KEYWORD={FORE},{BACK}\n\n"
|
||||||
"{FORE} and {BACK} can be omitted, and the default will be used\n"
|
"{FORE} and {BACK} can be omitted, and the default will be used\n"
|
||||||
"\n" "Keywords:\n"
|
"\n Keywords:\n"
|
||||||
" Global: errors, disabled, reverse, gauge, viewunderline\n"
|
" Global: errors, disabled, reverse, gauge, viewunderline\n"
|
||||||
" input, inputmark, inputunchanged, commandlinemark\n"
|
" input, inputmark, inputunchanged, commandlinemark\n"
|
||||||
" bbarhotkey, bbarbutton, statusbar\n"
|
" bbarhotkey, bbarbutton, statusbar\n"
|
||||||
@ -335,12 +332,13 @@ mc_args_new_color_group (void)
|
|||||||
" Dialog boxes: dnormal, dfocus, dhotnormal, dhotfocus, errdhotnormal,\n"
|
" Dialog boxes: dnormal, dfocus, dhotnormal, dhotfocus, errdhotnormal,\n"
|
||||||
" errdhotfocus\n"
|
" errdhotfocus\n"
|
||||||
" Menus: menunormal, menuhot, menusel, menuhotsel, menuinactive\n"
|
" Menus: menunormal, menuhot, menusel, menuhotsel, menuinactive\n"
|
||||||
|
" Popup menus: pmenunormal, pmenusel, pmenutitle\n"
|
||||||
" Editor: editnormal, editbold, editmarked, editwhitespace,\n"
|
" Editor: editnormal, editbold, editmarked, editwhitespace,\n"
|
||||||
" editlinestate\n"),
|
" editlinestate\n"
|
||||||
/* TRANSLATORS: don't translate keywords and names of colors */
|
" Viewer: viewunderline\n"
|
||||||
_
|
" Help: helpnormal, helpitalic, helpbold, helplink, helpslink\n"),
|
||||||
(" Help: helpnormal, helpitalic, helpbold, helplink, helpslink\n"
|
/* TRANSLATORS: don't translate color names */
|
||||||
"\n" "Colors:\n"
|
_("Colors:\n"
|
||||||
" black, gray, red, brightred, green, brightgreen, brown,\n"
|
" black, gray, red, brightred, green, brightgreen, brown,\n"
|
||||||
" yellow, blue, brightblue, magenta, brightmagenta, cyan,\n"
|
" yellow, blue, brightblue, magenta, brightmagenta, cyan,\n"
|
||||||
" brightcyan, lightgray and white\n\n"));
|
" brightcyan, lightgray and white\n\n"));
|
||||||
|
Loading…
Reference in New Issue
Block a user