From 6cad72ff7653b283b1a7d78244053b40e3d9b5a3 Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Mon, 14 Apr 2008 20:34:19 +0200 Subject: [PATCH] Allow left, right and enter key while selecting a partition type --- src/chgtype.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/chgtype.c b/src/chgtype.c index 17722ef5..af7e9988 100644 --- a/src/chgtype.c +++ b/src/chgtype.c @@ -211,6 +211,13 @@ static void change_part_type_ncurses2(const disk_t *disk_car, partition_t *parti offset++; break; case KEY_LEFT: + if(current_element_num > INTER_CHGTYPE) + current_element_num-=INTER_CHGTYPE; + else + current_element_num=0; + if(current_element_num < offset) + offset=current_element_num; + break; case KEY_PPAGE: if(current_element_num > 3*INTER_CHGTYPE-1) current_element_num-=3*INTER_CHGTYPE-1; @@ -220,16 +227,27 @@ static void change_part_type_ncurses2(const disk_t *disk_car, partition_t *parti offset=current_element_num; break; case KEY_RIGHT: + if(current_element_num+INTER_CHGTYPE < intr_nbr_line-1) + current_element_num+=INTER_CHGTYPE; + else + current_element_num=intr_nbr_line-1; + if(current_element_num >= offset+3*INTER_CHGTYPE) + offset=current_element_num-3*INTER_CHGTYPE+1; + break; case KEY_NPAGE: if(current_element_num+3*INTER_CHGTYPE-1 < intr_nbr_line-1) current_element_num+=3*INTER_CHGTYPE-1; else current_element_num=intr_nbr_line-1; if(current_element_num >= offset+3*INTER_CHGTYPE) - offset=current_element_num-1*INTER_CHGTYPE+1; + offset=current_element_num-3*INTER_CHGTYPE+1; break; case 'Q': case 'q': + case key_CR: +#ifdef PADENTER + case PADENTER: +#endif partition->arch->set_part_type(partition, part_name[current_element_num].index); return; }