Skip to content

Commit e905e1f

Browse files
authored
Merge pull request #4907 from egmontkob/3160-listbox-colors
Ticket #3160: Use new colors for listbox's selected entry
2 parents 7b9ed3f + 27fbae9 commit e905e1f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+155
-64
lines changed

lib/skin.h

Lines changed: 64 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -25,90 +25,92 @@
2525
#define SHADOW_COLOR mc_skin_color__cache[9]
2626

2727
/* Dialog colors */
28-
#define COLOR_NORMAL mc_skin_color__cache[10]
29-
#define COLOR_FOCUS mc_skin_color__cache[11]
30-
#define COLOR_HOT_NORMAL mc_skin_color__cache[12]
31-
#define COLOR_HOT_FOCUS mc_skin_color__cache[13]
32-
#define COLOR_TITLE mc_skin_color__cache[14]
28+
#define COLOR_NORMAL mc_skin_color__cache[10]
29+
#define COLOR_FOCUS mc_skin_color__cache[11]
30+
#define COLOR_HOT_NORMAL mc_skin_color__cache[12]
31+
#define COLOR_HOT_FOCUS mc_skin_color__cache[13]
32+
#define COLOR_SELECTED_NORMAL mc_skin_color__cache[14]
33+
#define COLOR_SELECTED_FOCUS mc_skin_color__cache[15]
34+
#define COLOR_TITLE mc_skin_color__cache[16]
3335

3436
/* Error dialog colors */
35-
#define ERROR_COLOR mc_skin_color__cache[15]
36-
#define ERROR_FOCUS mc_skin_color__cache[16]
37-
#define ERROR_HOT_NORMAL mc_skin_color__cache[17]
38-
#define ERROR_HOT_FOCUS mc_skin_color__cache[18]
39-
#define ERROR_TITLE mc_skin_color__cache[19]
37+
#define ERROR_COLOR mc_skin_color__cache[17]
38+
#define ERROR_FOCUS mc_skin_color__cache[18]
39+
#define ERROR_HOT_NORMAL mc_skin_color__cache[19]
40+
#define ERROR_HOT_FOCUS mc_skin_color__cache[20]
41+
#define ERROR_TITLE mc_skin_color__cache[21]
4042

4143
/* Menu colors */
42-
#define MENU_ENTRY_COLOR mc_skin_color__cache[20]
43-
#define MENU_SELECTED_COLOR mc_skin_color__cache[21]
44-
#define MENU_HOT_COLOR mc_skin_color__cache[22]
45-
#define MENU_HOTSEL_COLOR mc_skin_color__cache[23]
46-
#define MENU_INACTIVE_COLOR mc_skin_color__cache[24]
44+
#define MENU_ENTRY_COLOR mc_skin_color__cache[22]
45+
#define MENU_SELECTED_COLOR mc_skin_color__cache[23]
46+
#define MENU_HOT_COLOR mc_skin_color__cache[24]
47+
#define MENU_HOTSEL_COLOR mc_skin_color__cache[25]
48+
#define MENU_INACTIVE_COLOR mc_skin_color__cache[26]
4749

4850
/* Popup menu colors */
49-
#define PMENU_ENTRY_COLOR mc_skin_color__cache[25]
50-
#define PMENU_SELECTED_COLOR mc_skin_color__cache[26]
51-
#define PMENU_HOT_COLOR mc_skin_color__cache[27] // unused: not implemented yet
52-
#define PMENU_HOTSEL_COLOR mc_skin_color__cache[28] // unused: not implemented yet
53-
#define PMENU_TITLE_COLOR mc_skin_color__cache[29]
51+
#define PMENU_ENTRY_COLOR mc_skin_color__cache[27]
52+
#define PMENU_SELECTED_COLOR mc_skin_color__cache[28]
53+
#define PMENU_HOT_COLOR mc_skin_color__cache[29] // unused: not implemented yet
54+
#define PMENU_HOTSEL_COLOR mc_skin_color__cache[30] // unused: not implemented yet
55+
#define PMENU_TITLE_COLOR mc_skin_color__cache[31]
5456

55-
#define BUTTONBAR_HOTKEY_COLOR mc_skin_color__cache[30]
56-
#define BUTTONBAR_BUTTON_COLOR mc_skin_color__cache[31]
57+
#define BUTTONBAR_HOTKEY_COLOR mc_skin_color__cache[32]
58+
#define BUTTONBAR_BUTTON_COLOR mc_skin_color__cache[33]
5759

58-
#define STATUSBAR_COLOR mc_skin_color__cache[32]
60+
#define STATUSBAR_COLOR mc_skin_color__cache[34]
5961

6062
/*
6163
* This should be selectable independently. Default has to be black background
6264
* foreground does not matter at all.
6365
*/
64-
#define GAUGE_COLOR mc_skin_color__cache[33]
65-
#define INPUT_COLOR mc_skin_color__cache[34]
66-
#define INPUT_UNCHANGED_COLOR mc_skin_color__cache[35]
67-
#define INPUT_MARK_COLOR mc_skin_color__cache[36]
68-
#define INPUT_HISTORY_COLOR mc_skin_color__cache[37]
69-
#define COMMAND_HISTORY_COLOR mc_skin_color__cache[38]
70-
71-
#define HELP_NORMAL_COLOR mc_skin_color__cache[39]
72-
#define HELP_ITALIC_COLOR mc_skin_color__cache[40]
73-
#define HELP_BOLD_COLOR mc_skin_color__cache[41]
74-
#define HELP_LINK_COLOR mc_skin_color__cache[42]
75-
#define HELP_SLINK_COLOR mc_skin_color__cache[43]
76-
#define HELP_TITLE_COLOR mc_skin_color__cache[44]
77-
78-
#define VIEW_NORMAL_COLOR mc_skin_color__cache[45]
79-
#define VIEW_BOLD_COLOR mc_skin_color__cache[46]
80-
#define VIEW_UNDERLINED_COLOR mc_skin_color__cache[47]
81-
#define VIEW_SELECTED_COLOR mc_skin_color__cache[48]
66+
#define GAUGE_COLOR mc_skin_color__cache[35]
67+
#define INPUT_COLOR mc_skin_color__cache[36]
68+
#define INPUT_UNCHANGED_COLOR mc_skin_color__cache[37]
69+
#define INPUT_MARK_COLOR mc_skin_color__cache[38]
70+
#define INPUT_HISTORY_COLOR mc_skin_color__cache[39]
71+
#define COMMAND_HISTORY_COLOR mc_skin_color__cache[40]
72+
73+
#define HELP_NORMAL_COLOR mc_skin_color__cache[41]
74+
#define HELP_ITALIC_COLOR mc_skin_color__cache[42]
75+
#define HELP_BOLD_COLOR mc_skin_color__cache[43]
76+
#define HELP_LINK_COLOR mc_skin_color__cache[44]
77+
#define HELP_SLINK_COLOR mc_skin_color__cache[45]
78+
#define HELP_TITLE_COLOR mc_skin_color__cache[46]
79+
80+
#define VIEW_NORMAL_COLOR mc_skin_color__cache[47]
81+
#define VIEW_BOLD_COLOR mc_skin_color__cache[48]
82+
#define VIEW_UNDERLINED_COLOR mc_skin_color__cache[49]
83+
#define VIEW_SELECTED_COLOR mc_skin_color__cache[50]
8284

8385
/*
8486
* editor colors - only 4 for normal, search->found, select, and whitespace
8587
* respectively
8688
* Last is defined to view color.
8789
*/
88-
#define EDITOR_NORMAL_COLOR mc_skin_color__cache[49]
89-
#define EDITOR_NONPRINTABLE_COLOR mc_skin_color__cache[50]
90-
#define EDITOR_BOLD_COLOR mc_skin_color__cache[51]
91-
#define EDITOR_MARKED_COLOR mc_skin_color__cache[52]
92-
#define EDITOR_WHITESPACE_COLOR mc_skin_color__cache[53]
93-
#define EDITOR_RIGHT_MARGIN_COLOR mc_skin_color__cache[54]
94-
#define EDITOR_BACKGROUND mc_skin_color__cache[55]
95-
#define EDITOR_FRAME mc_skin_color__cache[56]
96-
#define EDITOR_FRAME_ACTIVE mc_skin_color__cache[57]
97-
#define EDITOR_FRAME_DRAG mc_skin_color__cache[58]
90+
#define EDITOR_NORMAL_COLOR mc_skin_color__cache[51]
91+
#define EDITOR_NONPRINTABLE_COLOR mc_skin_color__cache[52]
92+
#define EDITOR_BOLD_COLOR mc_skin_color__cache[53]
93+
#define EDITOR_MARKED_COLOR mc_skin_color__cache[54]
94+
#define EDITOR_WHITESPACE_COLOR mc_skin_color__cache[55]
95+
#define EDITOR_RIGHT_MARGIN_COLOR mc_skin_color__cache[56]
96+
#define EDITOR_BACKGROUND mc_skin_color__cache[57]
97+
#define EDITOR_FRAME mc_skin_color__cache[58]
98+
#define EDITOR_FRAME_ACTIVE mc_skin_color__cache[59]
99+
#define EDITOR_FRAME_DRAG mc_skin_color__cache[60]
98100
/* color of left 8 char status per line */
99-
#define LINE_STATE_COLOR mc_skin_color__cache[59]
100-
#define BOOK_MARK_COLOR mc_skin_color__cache[60]
101-
#define BOOK_MARK_FOUND_COLOR mc_skin_color__cache[61]
101+
#define LINE_STATE_COLOR mc_skin_color__cache[61]
102+
#define BOOK_MARK_COLOR mc_skin_color__cache[62]
103+
#define BOOK_MARK_FOUND_COLOR mc_skin_color__cache[63]
102104

103105
/* Diff colors */
104-
#define DFF_ADD_COLOR mc_skin_color__cache[62]
105-
#define DFF_CHG_COLOR mc_skin_color__cache[63]
106-
#define DFF_CHH_COLOR mc_skin_color__cache[64]
107-
#define DFF_CHD_COLOR mc_skin_color__cache[65]
108-
#define DFF_DEL_COLOR mc_skin_color__cache[66]
109-
#define DFF_ERROR_COLOR mc_skin_color__cache[67]
110-
111-
#define MC_SKIN_COLOR_CACHE_COUNT 68
106+
#define DFF_ADD_COLOR mc_skin_color__cache[64]
107+
#define DFF_CHG_COLOR mc_skin_color__cache[65]
108+
#define DFF_CHH_COLOR mc_skin_color__cache[66]
109+
#define DFF_CHD_COLOR mc_skin_color__cache[67]
110+
#define DFF_DEL_COLOR mc_skin_color__cache[68]
111+
#define DFF_ERROR_COLOR mc_skin_color__cache[69]
112+
113+
#define MC_SKIN_COLOR_CACHE_COUNT 70
112114

113115
/*** enums ***************************************************************************************/
114116

lib/skin/colors.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,8 @@ mc_skin_color_cache_init (void)
259259
COLOR_FOCUS = mc_skin_color_get ("dialog", "dfocus");
260260
COLOR_HOT_NORMAL = mc_skin_color_get ("dialog", "dhotnormal");
261261
COLOR_HOT_FOCUS = mc_skin_color_get ("dialog", "dhotfocus");
262+
COLOR_SELECTED_NORMAL = mc_skin_color_get ("dialog", "dselnormal");
263+
COLOR_SELECTED_FOCUS = mc_skin_color_get ("dialog", "dselfocus");
262264
COLOR_TITLE = mc_skin_color_get ("dialog", "dtitle");
263265

264266
ERROR_COLOR = mc_skin_color_get ("error", "_default_");

lib/widget/dialog.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,18 +456,24 @@ dlg_set_default_colors (void)
456456
dialog_colors[DLG_COLOR_FOCUS] = COLOR_FOCUS;
457457
dialog_colors[DLG_COLOR_HOT_NORMAL] = COLOR_HOT_NORMAL;
458458
dialog_colors[DLG_COLOR_HOT_FOCUS] = COLOR_HOT_FOCUS;
459+
dialog_colors[DLG_COLOR_SELECTED_NORMAL] = COLOR_SELECTED_NORMAL;
460+
dialog_colors[DLG_COLOR_SELECTED_FOCUS] = COLOR_SELECTED_FOCUS;
459461
dialog_colors[DLG_COLOR_TITLE] = COLOR_TITLE;
460462

461463
alarm_colors[DLG_COLOR_NORMAL] = ERROR_COLOR;
462464
alarm_colors[DLG_COLOR_FOCUS] = ERROR_FOCUS;
463465
alarm_colors[DLG_COLOR_HOT_NORMAL] = ERROR_HOT_NORMAL;
464466
alarm_colors[DLG_COLOR_HOT_FOCUS] = ERROR_HOT_FOCUS;
467+
alarm_colors[DLG_COLOR_SELECTED_NORMAL] = ERROR_HOT_FOCUS; // unused
468+
alarm_colors[DLG_COLOR_SELECTED_FOCUS] = ERROR_FOCUS; // unused
465469
alarm_colors[DLG_COLOR_TITLE] = ERROR_TITLE;
466470

467471
listbox_colors[DLG_COLOR_NORMAL] = PMENU_ENTRY_COLOR;
468472
listbox_colors[DLG_COLOR_FOCUS] = PMENU_SELECTED_COLOR;
469473
listbox_colors[DLG_COLOR_HOT_NORMAL] = PMENU_ENTRY_COLOR;
470474
listbox_colors[DLG_COLOR_HOT_FOCUS] = PMENU_SELECTED_COLOR;
475+
listbox_colors[DLG_COLOR_SELECTED_NORMAL] = PMENU_SELECTED_COLOR; // unused
476+
listbox_colors[DLG_COLOR_SELECTED_FOCUS] = PMENU_SELECTED_COLOR; // unused
471477
listbox_colors[DLG_COLOR_TITLE] = PMENU_TITLE_COLOR;
472478
}
473479

lib/widget/dialog.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ typedef enum
3737
DLG_COLOR_FOCUS,
3838
DLG_COLOR_HOT_NORMAL,
3939
DLG_COLOR_HOT_FOCUS,
40+
DLG_COLOR_SELECTED_NORMAL,
41+
DLG_COLOR_SELECTED_FOCUS,
4042
DLG_COLOR_TITLE,
4143
DLG_COLOR_COUNT
4244
} dlg_colors_enum_t;

lib/widget/listbox.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ listbox_draw (WListbox *l, gboolean focused)
148148

149149
disabled = widget_get_state (wl, WST_DISABLED);
150150
normalc = disabled ? DISABLED_COLOR : colors[DLG_COLOR_NORMAL];
151-
selc = disabled ? DISABLED_COLOR : colors[focused ? DLG_COLOR_HOT_FOCUS : DLG_COLOR_FOCUS];
151+
selc = disabled ? DISABLED_COLOR
152+
: colors[focused ? DLG_COLOR_SELECTED_FOCUS : DLG_COLOR_SELECTED_NORMAL];
152153

153154
if (l->list != NULL)
154155
{

misc/skins/dark.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
dfocus = blue;cyan
4747
dhotnormal = white;
4848
dhotfocus = white;cyan
49+
dselnormal = blue;cyan
50+
dselfocus = white;cyan
4951
dtitle = white;
5052

5153
[error]

misc/skins/darkfar.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
dfocus = blue;cyan
4747
dhotnormal = white;
4848
dhotfocus = white;cyan
49+
dselnormal = blue;cyan
50+
dselfocus = white;cyan
4951
dtitle = white;
5052

5153
[error]

misc/skins/default.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
dfocus = black;cyan
4747
dhotnormal = blue;lightgray
4848
dhotfocus = blue;cyan
49+
dselnormal = black;cyan
50+
dselfocus = blue;cyan
4951
dtitle = blue;lightgray
5052

5153
[error]

misc/skins/double-lines.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
dfocus = black;cyan
4747
dhotnormal = blue;lightgray
4848
dhotfocus = blue;cyan
49+
dselnormal = black;cyan
50+
dselfocus = blue;cyan
4951
dtitle = blue;lightgray
5052

5153
[error]

misc/skins/featured-plus.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
dfocus = black;cyan
4949
dhotnormal = blue;lightgray
5050
dhotfocus = blue;cyan
51+
dselnormal = black;cyan
52+
dselfocus = blue;cyan
5153
dtitle = blue;lightgray
5254

5355
[error]

0 commit comments

Comments
 (0)