diff --git a/src/menu.c b/src/menu.c
index 25c8d27..71799d3 100644
a
|
b
|
static void menubar_paint_idx (WMenu *menubar, int idx, int color) |
88 | 88 | |
89 | 89 | if (entry->text.start == NULL) { |
90 | 90 | /* menu separator */ |
91 | | tty_setcolor (SELECTED_COLOR); |
| 91 | tty_setcolor (MENU_ENTRY_COLOR); |
92 | 92 | |
93 | 93 | if (!tty_is_slow ()) { |
94 | 94 | widget_move (&menubar->widget, y, x - 1); |
… |
… |
static inline void menubar_draw_drop (WMenu *menubar) |
134 | 134 | if (column + menubar->max_entry_len + 4 > menubar->widget.cols) |
135 | 135 | column = menubar->widget.cols - menubar->max_entry_len - 4; |
136 | 136 | |
137 | | tty_setcolor (SELECTED_COLOR); |
| 137 | tty_setcolor (MENU_ENTRY_COLOR); |
138 | 138 | draw_box (menubar->widget.parent, |
139 | 139 | menubar->widget.y + 1, menubar->widget.x + column, |
140 | 140 | count + 2, menubar->max_entry_len + 4); |
… |
… |
static inline void menubar_draw_drop (WMenu *menubar) |
148 | 148 | menubar_paint_idx (menubar, menubar->subsel, MENU_SELECTED_COLOR); |
149 | 149 | } |
150 | 150 | |
| 151 | static void menubar_set_color (WMenu *menubar, int current, gboolean hotkey) |
| 152 | { |
| 153 | if (!menubar->active) |
| 154 | tty_setcolor (hotkey ? COLOR_HOT_FOCUS : SELECTED_COLOR); |
| 155 | else if (current == menubar->selected) |
| 156 | tty_setcolor (hotkey ? MENU_HOTSEL_COLOR : MENU_SELECTED_COLOR); |
| 157 | else |
| 158 | tty_setcolor (hotkey ? MENU_HOT_COLOR : MENU_ENTRY_COLOR); |
| 159 | } |
| 160 | |
151 | 161 | static void menubar_draw (WMenu *menubar) |
152 | 162 | { |
153 | 163 | const int items = menubar->items; |
154 | 164 | int i; |
155 | 165 | |
156 | 166 | /* First draw the complete menubar */ |
157 | | tty_setcolor (SELECTED_COLOR); |
| 167 | tty_setcolor (menubar->active ? MENU_ENTRY_COLOR : SELECTED_COLOR); |
158 | 168 | tty_draw_hline (menubar->widget.y, menubar->widget.x, ' ', menubar->widget.cols); |
159 | 169 | |
160 | | tty_setcolor (SELECTED_COLOR); |
161 | 170 | /* Now each one of the entries */ |
162 | 171 | for (i = 0; i < items; i++){ |
163 | | tty_setcolor ((menubar->active && i == menubar->selected) ? |
164 | | MENU_SELECTED_COLOR : SELECTED_COLOR); |
| 172 | menubar_set_color (menubar, i, FALSE); |
165 | 173 | widget_move (&menubar->widget, 0, menubar->menu [i]->start_x); |
166 | 174 | |
167 | 175 | tty_print_string (menubar->menu[i]->text.start); |
168 | 176 | |
169 | 177 | if (menubar->menu[i]->text.hotkey != NULL) { |
170 | | tty_setcolor ((menubar->active && i == menubar->selected) ? |
171 | | MENU_HOTSEL_COLOR : COLOR_HOT_FOCUS); |
| 178 | menubar_set_color (menubar, i, TRUE); |
172 | 179 | tty_print_string (menubar->menu[i]->text.hotkey); |
173 | | tty_setcolor ((menubar->active && i == menubar->selected) ? |
174 | | MENU_SELECTED_COLOR : SELECTED_COLOR); |
| 180 | menubar_set_color (menubar, i, FALSE); |
175 | 181 | } |
176 | 182 | if (menubar->menu[i]->text.end != NULL) |
177 | 183 | tty_print_string (menubar->menu[i]->text.end); |