diff --git a/doc/man/mc.1.in b/doc/man/mc.1.in
index 2413b1e..3c8f4a9 100644
a
|
b
|
Color pair definitions |
3708 | 3708 | .\"Skins colors" |
3709 | 3709 | .br |
3710 | 3710 | .\"LINK2" |
| 3711 | Color and attribute aliases |
| 3712 | .\"Skins aliases" |
| 3713 | .br |
| 3714 | .\"LINK2" |
3711 | 3715 | Draw lines |
3712 | 3716 | .\"Skins lines" |
3713 | 3717 | .br |
… |
… |
Colors\&. |
3915 | 3919 | .\"Colors" |
3916 | 3920 | section. |
3917 | 3921 | |
| 3922 | .\"NODE " Skins aliases" |
| 3923 | .SH " Color and attribute aliases" |
| 3924 | This optional section might define aliases for single colors (not color pairs) |
| 3925 | as well as combination of attributes; in other words, for semicolon-separated |
| 3926 | fragments of parameters. Aliases are not recursive, they might not refer to |
| 3927 | other aliases. |
| 3928 | .PP |
| 3929 | Example: |
| 3930 | .br |
| 3931 | .nf |
| 3932 | [aliases] |
| 3933 | myfavfg=green |
| 3934 | myfavbg=black |
| 3935 | myfavattr=bold+italic |
| 3936 | [core] |
| 3937 | _default_=myfavfg;myfavbg;myfavattr |
| 3938 | .fi |
| 3939 | |
3918 | 3940 | .\"NODE " Skins lines" |
3919 | 3941 | .SH " Draw lines" |
3920 | 3942 | Lines sets in section |
diff --git a/lib/skin/colors.c b/lib/skin/colors.c
index 7f55684..ccbfb76 100644
a
|
b
|
mc_skin_color_get_with_defaults (const gchar * group, const gchar * name) |
120 | 120 | |
121 | 121 | /* --------------------------------------------------------------------------------------------- */ |
122 | 122 | |
| 123 | /* If an alias is found, alloc a new string for the resolved value and free the input parameter. |
| 124 | Otherwise it's a no-op returning the original string. */ |
| 125 | static gchar * |
| 126 | mc_skin_color_look_up_alias (mc_skin_t * mc_skin, gchar * str) |
| 127 | { |
| 128 | gsize items_count; |
| 129 | gchar **values; |
| 130 | gchar *ret = str; |
| 131 | |
| 132 | values = mc_config_get_string_list (mc_skin->config, "aliases", str, &items_count); |
| 133 | if (items_count == 1) |
| 134 | { |
| 135 | g_free (str); |
| 136 | ret = g_strdup (values[0]); |
| 137 | } |
| 138 | g_strfreev (values); |
| 139 | return ret; |
| 140 | } |
| 141 | |
| 142 | /* --------------------------------------------------------------------------------------------- */ |
| 143 | |
123 | 144 | static mc_skin_color_t * |
124 | 145 | mc_skin_color_get_from_ini_file (mc_skin_t * mc_skin, const gchar * group, const gchar * key) |
125 | 146 | { |
… |
… |
mc_skin_color_get_from_ini_file (mc_skin_t * mc_skin, const gchar * group, const |
142 | 163 | } |
143 | 164 | |
144 | 165 | tmp = mc_skin_color_get_with_defaults (group, "_default_"); |
145 | | mc_skin_color->fgcolor = (items_count > 0 && values[0][0]) ? g_strstrip (g_strdup (values[0])) : |
| 166 | mc_skin_color->fgcolor = (items_count > 0 && values[0][0]) ? |
| 167 | mc_skin_color_look_up_alias (mc_skin, g_strstrip (g_strdup (values[0]))) : |
146 | 168 | (tmp != NULL) ? g_strdup (tmp->fgcolor) : NULL; |
147 | | mc_skin_color->bgcolor = (items_count > 1 && values[1][0]) ? g_strstrip (g_strdup (values[1])) : |
| 169 | mc_skin_color->bgcolor = (items_count > 1 && values[1][0]) ? |
| 170 | mc_skin_color_look_up_alias (mc_skin, g_strstrip (g_strdup (values[1]))) : |
148 | 171 | (tmp != NULL) ? g_strdup (tmp->bgcolor) : NULL; |
149 | | mc_skin_color->attrs = (items_count > 2 && values[2][0]) ? g_strstrip (g_strdup (values[2])) : |
| 172 | mc_skin_color->attrs = (items_count > 2 && values[2][0]) ? |
| 173 | mc_skin_color_look_up_alias (mc_skin, g_strstrip (g_strdup (values[2]))) : |
150 | 174 | (tmp != NULL) ? g_strdup (tmp->attrs) : NULL; |
151 | 175 | |
152 | 176 | g_strfreev (values); |
… |
… |
mc_skin_color_cache_init (void) |
265 | 289 | static gboolean |
266 | 290 | mc_skin_color_check_inisection (const gchar * group) |
267 | 291 | { |
268 | | return !((strcasecmp ("skin", group) == 0) |
| 292 | return !((strcasecmp ("skin", group) == 0) || (strcasecmp ("aliases", group) == 0) |
269 | 293 | || (strcasecmp ("lines", group) == 0) || (strncasecmp ("widget-", group, 7) == 0)); |
270 | 294 | } |
271 | 295 | |
diff --git a/misc/skins/gray-green-purple256.ini b/misc/skins/gray-green-purple256.ini
index 964b26f..f6ea39a 100644
a
|
b
|
|
25 | 25 | dleftmiddle = ╟ |
26 | 26 | drightmiddle = ╢ |
27 | 27 | |
| 28 | [aliases] |
| 29 | bgmain = gray22 |
| 30 | bgbitdarker = gray21 |
| 31 | bgdarker = gray20 |
| 32 | main1 = rgb141 |
| 33 | main2 = rgb303 |
| 34 | |
28 | 35 | [core] |
29 | | _default_ = black;gray22 |
30 | | selected = ;rgb141 |
31 | | marked = rgb303;;bold |
32 | | markselect = rgb303;rgb141;bold |
33 | | gauge = ;rgb141 |
| 36 | _default_ = black;bgmain |
| 37 | selected = ;main1 |
| 38 | marked = main2;;bold |
| 39 | markselect = main2;main1;bold |
| 40 | gauge = ;main1 |
34 | 41 | input = |
35 | 42 | inputunchanged = gray |
36 | | inputmark = ;rgb141 |
37 | | disabled = gray8;gray20 |
| 43 | inputmark = ;main1 |
| 44 | disabled = gray8;bgdarker |
38 | 45 | reverse = |
39 | | commandlinemark = ;rgb141 |
40 | | header = rgb303 |
| 46 | commandlinemark = ;main1 |
| 47 | header = main2 |
41 | 48 | |
42 | 49 | [dialog] |
43 | | _default_ = black;gray20 |
44 | | dfocus = ;rgb141 |
45 | | dhotnormal = rgb303 |
46 | | dhotfocus = rgb303;rgb141 |
47 | | dtitle = rgb303 |
| 50 | _default_ = black;bgdarker |
| 51 | dfocus = ;main1 |
| 52 | dhotnormal = main2 |
| 53 | dhotfocus = main2;main1 |
| 54 | dtitle = main2 |
48 | 55 | |
49 | 56 | [error] |
50 | 57 | # "white" might change color when going bold, so use "rgb555" instead |
51 | 58 | _default_ = rgb555;rgb400;bold |
52 | | errdfocus = ;rgb303 |
53 | | errdhotnormal = rgb141 |
54 | | errdhotfocus = rgb141;rgb303 |
55 | | errdtitle = rgb141 |
| 59 | errdfocus = ;main2 |
| 60 | errdhotnormal = main1 |
| 61 | errdhotfocus = main1;main2 |
| 62 | errdtitle = main1 |
56 | 63 | |
57 | 64 | [filehighlight] |
58 | 65 | directory = |
… |
… |
|
72 | 79 | database = rgb421 |
73 | 80 | |
74 | 81 | [menu] |
75 | | _default_ = black;gray20 |
76 | | menusel = ;rgb141 |
77 | | menuhot = rgb303 |
78 | | menuhotsel = rgb303;rgb141 |
| 82 | _default_ = black;bgdarker |
| 83 | menusel = ;main1 |
| 84 | menuhot = main2 |
| 85 | menuhotsel = main2;main1 |
79 | 86 | menuinactive = |
80 | 87 | |
81 | 88 | [popupmenu] |
82 | | _default_ = black;gray20 |
83 | | menusel = ;rgb141 |
84 | | menutitle = rgb303 |
| 89 | _default_ = black;bgdarker |
| 90 | menusel = ;main1 |
| 91 | menutitle = main2 |
85 | 92 | |
86 | 93 | [buttonbar] |
87 | | hotkey = black;gray22 |
88 | | button = black;gray20 |
| 94 | hotkey = black;bgmain |
| 95 | button = black;bgdarker |
89 | 96 | |
90 | 97 | [statusbar] |
91 | | _default_ = black;gray20 |
| 98 | _default_ = black;bgdarker |
92 | 99 | |
93 | 100 | [help] |
94 | | _default_ = black;gray20 |
| 101 | _default_ = black;bgdarker |
95 | 102 | helpitalic = rgb020 |
96 | 103 | helpbold = rgb300 |
97 | | helplink = rgb303;;underline |
98 | | helpslink = gray20;rgb303 |
99 | | helptitle = rgb303 |
| 104 | helplink = main2;;underline |
| 105 | helpslink = bgdarker;main2 |
| 106 | helptitle = main2 |
100 | 107 | |
101 | 108 | [editor] |
102 | | _default_ = black;gray22 |
| 109 | _default_ = black;bgmain |
103 | 110 | editbold = rgb400 |
104 | | editmarked = ;rgb141 |
105 | | editwhitespace = rgb400;gray20 |
106 | | editlinestate = ;gray20 |
| 111 | editmarked = ;main1 |
| 112 | editwhitespace = rgb400;bgdarker |
| 113 | editlinestate = ;bgdarker |
107 | 114 | bookmark = ;rgb531 |
108 | | bookmarkfound = ;rgb303 |
109 | | editrightmargin = rgb400;gray20 |
| 115 | bookmarkfound = ;main2 |
| 116 | editrightmargin = rgb400;bgdarker |
110 | 117 | # editbg = |
111 | | editframe = rgb303; |
| 118 | editframe = main2; |
112 | 119 | editframeactive = black; |
113 | 120 | editframedrag = rgb400; |
114 | 121 | window-state-char = ↕ |
115 | 122 | window-close-char = ✕ |
116 | 123 | |
117 | 124 | [viewer] |
118 | | _default_ = black;gray22 |
| 125 | _default_ = black;bgmain |
119 | 126 | # "black" might change color when going bold, so use "rgb000" instead |
120 | 127 | viewbold = rgb000;;bold |
121 | 128 | viewunderline = ;;underline |
122 | | viewselected = rgb303;rgb141;bold |
| 129 | viewselected = main2;main1;bold |
123 | 130 | |
124 | 131 | [diffviewer] |
125 | 132 | added = ;rgb340 |
126 | | changedline = ;gray20 |
127 | | changednew = rgb303;gray20 |
128 | | changed = ;gray21 |
| 133 | changedline = ;bgdarker |
| 134 | changednew = main2;bgdarker |
| 135 | changed = ;bgbitdarker |
129 | 136 | removed = ;rgb511 |
130 | 137 | # "white" might change color when going bold, so use "rgb555" instead |
131 | 138 | error = rgb555;rgb400;bold |
diff --git a/misc/skins/gray-orange-blue256.ini b/misc/skins/gray-orange-blue256.ini
index f8426f1..027b679 100644
a
|
b
|
|
25 | 25 | dleftmiddle = ╟ |
26 | 26 | drightmiddle = ╢ |
27 | 27 | |
| 28 | [aliases] |
| 29 | bgmain = gray22 |
| 30 | bgbitdarker = gray21 |
| 31 | bgdarker = gray20 |
| 32 | main1 = rgb530 |
| 33 | main2 = rgb004 |
| 34 | |
28 | 35 | [core] |
29 | | _default_ = black;gray22 |
30 | | selected = ;rgb530 |
31 | | marked = rgb004;;bold |
32 | | markselect = rgb004;rgb530;bold |
33 | | gauge = ;rgb530 |
| 36 | _default_ = black;bgmain |
| 37 | selected = ;main1 |
| 38 | marked = main2;;bold |
| 39 | markselect = main2;main1;bold |
| 40 | gauge = ;main1 |
34 | 41 | input = |
35 | 42 | inputunchanged = gray |
36 | | inputmark = ;rgb530 |
37 | | disabled = gray8;gray20 |
| 43 | inputmark = ;main1 |
| 44 | disabled = gray8;bgdarker |
38 | 45 | reverse = |
39 | | commandlinemark = ;rgb530 |
40 | | header = rgb004 |
| 46 | commandlinemark = ;main1 |
| 47 | header = main2 |
41 | 48 | |
42 | 49 | [dialog] |
43 | | _default_ = black;gray20 |
44 | | dfocus = ;rgb530 |
45 | | dhotnormal = rgb004 |
46 | | dhotfocus = rgb004;rgb530 |
47 | | dtitle = rgb004 |
| 50 | _default_ = black;bgdarker |
| 51 | dfocus = ;main1 |
| 52 | dhotnormal = main2 |
| 53 | dhotfocus = main2;main1 |
| 54 | dtitle = main2 |
48 | 55 | |
49 | 56 | [error] |
50 | 57 | # "white" might change color when going bold, so use "rgb555" instead |
51 | 58 | _default_ = rgb555;rgb400;bold |
52 | | errdfocus = ;rgb004 |
53 | | errdhotnormal = rgb530 |
54 | | errdhotfocus = rgb530;rgb004 |
55 | | errdtitle = rgb530 |
| 59 | errdfocus = ;main2 |
| 60 | errdhotnormal = main1 |
| 61 | errdhotfocus = main1;main2 |
| 62 | errdtitle = main1 |
56 | 63 | |
57 | 64 | [filehighlight] |
58 | 65 | directory = |
… |
… |
|
72 | 79 | database = rgb421 |
73 | 80 | |
74 | 81 | [menu] |
75 | | _default_ = black;gray20 |
76 | | menusel = ;rgb530 |
77 | | menuhot = rgb004 |
78 | | menuhotsel = rgb004;rgb530 |
| 82 | _default_ = black;bgdarker |
| 83 | menusel = ;main1 |
| 84 | menuhot = main2 |
| 85 | menuhotsel = main2;main1 |
79 | 86 | menuinactive = |
80 | 87 | |
81 | 88 | [popupmenu] |
82 | | _default_ = black;gray20 |
83 | | menusel = ;rgb530 |
84 | | menutitle = rgb004 |
| 89 | _default_ = black;bgdarker |
| 90 | menusel = ;main1 |
| 91 | menutitle = main2 |
85 | 92 | |
86 | 93 | [buttonbar] |
87 | | hotkey = black;gray22 |
88 | | button = black;gray20 |
| 94 | hotkey = black;bgmain |
| 95 | button = black;bgdarker |
89 | 96 | |
90 | 97 | [statusbar] |
91 | | _default_ = black;gray20 |
| 98 | _default_ = black;bgdarker |
92 | 99 | |
93 | 100 | [help] |
94 | | _default_ = black;gray20 |
| 101 | _default_ = black;bgdarker |
95 | 102 | helpitalic = rgb020 |
96 | 103 | helpbold = rgb300 |
97 | | helplink = rgb004;;underline |
98 | | helpslink = gray20;rgb004 |
99 | | helptitle = rgb004 |
| 104 | helplink = main2;;underline |
| 105 | helpslink = bgdarker;main2 |
| 106 | helptitle = main2 |
100 | 107 | |
101 | 108 | [editor] |
102 | | _default_ = black;gray22 |
| 109 | _default_ = black;bgmain |
103 | 110 | editbold = rgb400 |
104 | | editmarked = ;rgb530 |
105 | | editwhitespace = rgb400;gray20 |
106 | | editlinestate = ;gray20 |
| 111 | editmarked = ;main1 |
| 112 | editwhitespace = rgb400;bgdarker |
| 113 | editlinestate = ;bgdarker |
107 | 114 | bookmark = ;rgb531 |
108 | | bookmarkfound = ;rgb004 |
109 | | editrightmargin = rgb400;gray20 |
| 115 | bookmarkfound = ;main2 |
| 116 | editrightmargin = rgb400;bgdarker |
110 | 117 | # editbg = |
111 | | editframe = rgb004; |
| 118 | editframe = main2; |
112 | 119 | editframeactive = black; |
113 | 120 | editframedrag = rgb400; |
114 | 121 | window-state-char = ↕ |
115 | 122 | window-close-char = ✕ |
116 | 123 | |
117 | 124 | [viewer] |
118 | | _default_ = black;gray22 |
| 125 | _default_ = black;bgmain |
119 | 126 | # "black" might change color when going bold, so use "rgb000" instead |
120 | 127 | viewbold = rgb000;;bold |
121 | 128 | viewunderline = ;;underline |
122 | | viewselected = rgb004;rgb530;bold |
| 129 | viewselected = main2;main1;bold |
123 | 130 | |
124 | 131 | [diffviewer] |
125 | 132 | added = ;rgb340 |
126 | | changedline = ;gray20 |
127 | | changednew = rgb004;gray20 |
128 | | changed = ;gray21 |
| 133 | changedline = ;bgdarker |
| 134 | changednew = main2;bgdarker |
| 135 | changed = ;bgbitdarker |
129 | 136 | removed = ;rgb511 |
130 | 137 | # "white" might change color when going bold, so use "rgb555" instead |
131 | 138 | error = rgb555;rgb400;bold |