static void cmd_zz(key_info_t key_info, keys_info_t *keys_info) { if(!all_lines_visible(menu)) { if(menu->pos <= (menu->win_rows - 3)/2) menu->top = 0; else if(menu->pos > menu->len - DIV_ROUND_UP(menu->win_rows - 3, 2)) menu->top = menu->len - (menu->win_rows - 3 + 1); else menu->top = menu->pos - DIV_ROUND_UP(menu->win_rows - 3, 2); update_menu(); } }
static void cmd_zz(key_info_t key_info, keys_info_t *keys_info) { if(!all_lines_visible(menu)) { if(menu->pos <= (getmaxy(menu_win) - 3)/2) menu->top = 0; else if(menu->pos > menu->len - DIV_ROUND_UP(getmaxy(menu_win) - 3, 2)) menu->top = menu->len - (getmaxy(menu_win) - 3 + 1); else menu->top = menu->pos - DIV_ROUND_UP(getmaxy(menu_win) - 3, 2); menu_partial_redraw(); } }