{
/* draw outer menu (prob dont need this every render) */
/* wclear(menu->menu_win); */
- wattron(menu->menu_win, COLOR_PAIR(
- (menu->focused == true) ?
- TS_MENU_SELECTED: TS_MENU_NONSELECTED
- ));
+ int titlecolor;
+ titlecolor = COLOR_PAIR((menu->focused == true) ? TS_MENU_SELECTED: TS_MENU_NONSELECTED);
+ wattron(menu->menu_win, titlecolor);
mvwprintw(menu->menu_win, 0, MENU_PAD_LEFT, menu->menu_name);
- wattroff(menu->menu_win, COLOR_PAIR(0));
+ wattroff(menu->menu_win, titlecolor);
/* draw inner menu */
wclear(menu->sub_win);
render_item(Menu* menu, int item_index, int start_y)
{
MenuItem* curitem;
+ int hlcolor;
curitem = menu->menu_items[item_index];
/* color selected item */
- wattron(menu->sub_win, COLOR_PAIR(
- (item_index == menu->selected_item && menu->focused == true) ?
- TS_SELECTED : TS_NONSELECTED
- ));
+ hlcolor = COLOR_PAIR((item_index == menu->selected_item && menu->focused == true) ? TS_SELECTED : TS_NONSELECTED);
+ wattron(menu->sub_win, hlcolor);
mvwprintw(menu->sub_win, start_y, 0, curitem->title);
- wattroff(menu->sub_win, COLOR_PAIR(0));
+ wattroff(menu->sub_win, hlcolor);
/* display number of items */
if (strlen(curitem->description) > 0) {
box(popup_win, 0, 0);
set_menu_win(new_popup_menu, popup_win);
+ set_menu_focus(new_popup_menu, 1);
return new_popup_menu;
}
popup_win = get_menu_win(popup_menu);
wclear(popup_win);
- /* box(popup_win, 0, 0); */
+ box(popup_win, 0, 0);
+
render_menu(popup_menu);
wrefresh(popup_win);