fix kouho selection.
This commit is contained in:
parent
b887972fb2
commit
64d50afc6b
9
strans.c
9
strans.c
@ -24,7 +24,7 @@ static void
|
|||||||
clearkouho(void)
|
clearkouho(void)
|
||||||
{
|
{
|
||||||
im.nkouho = 0;
|
im.nkouho = 0;
|
||||||
im.sel = 0;
|
im.sel = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -200,7 +200,7 @@ keystroke(u32int ks, u32int mod, Str *com)
|
|||||||
return 0;
|
return 0;
|
||||||
if(ks == Kdown && im.sel < im.nkouho - 1)
|
if(ks == Kdown && im.sel < im.nkouho - 1)
|
||||||
im.sel++;
|
im.sel++;
|
||||||
if(ks == Kup && im.sel > 0)
|
if(ks == Kup && im.sel >= 0)
|
||||||
im.sel--;
|
im.sel--;
|
||||||
show();
|
show();
|
||||||
return 1;
|
return 1;
|
||||||
@ -257,6 +257,11 @@ keystroke(u32int ks, u32int mod, Str *com)
|
|||||||
return 1;
|
return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
if(ks == '0' && im.nkouho > 0){
|
||||||
|
commit(com);
|
||||||
|
reset();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
if(ks > 0x7f || ks == ' '){
|
if(ks > 0x7f || ks == ' '){
|
||||||
commit(com);
|
commit(com);
|
||||||
sputr(com, ks);
|
sputr(com, ks);
|
||||||
|
|||||||
6
win.c
6
win.c
@ -72,8 +72,10 @@ drawkouho(Drawcmd *dc, int first, int n, int w, int h)
|
|||||||
|
|
||||||
memset(img, (uchar)Colbg, w * h * sizeof(u32int));
|
memset(img, (uchar)Colbg, w * h * sizeof(u32int));
|
||||||
drawstr(img, 0, 0, dc->pre.r, dc->pre.n, w, h);
|
drawstr(img, 0, 0, dc->pre.r, dc->pre.n, w, h);
|
||||||
sely = Fontsz + (dc->sel - first) * Fontsz;
|
if(dc->sel >= 0){
|
||||||
memset(img + sely * w, (uchar)Colsel, Fontsz * w * sizeof(u32int));
|
sely = Fontsz + (dc->sel - first) * Fontsz;
|
||||||
|
memset(img + sely * w, (uchar)Colsel, Fontsz * w * sizeof(u32int));
|
||||||
|
}
|
||||||
for(i = 0, y = Fontsz; i < n; i++, y += Fontsz){
|
for(i = 0, y = Fontsz; i < n; i++, y += Fontsz){
|
||||||
s = &dc->kouho[first+i];
|
s = &dc->kouho[first+i];
|
||||||
putfont(img, w, h, 0, y, '1' + i + Asciitofull);
|
putfont(img, w, h, 0, y, '1' + i + Asciitofull);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user