popup: refine the input panel

This commit is contained in:
2026-08-14 20:54:09 +09:00
parent 3576c4ea68
commit f222b4d573
7 changed files with 399 additions and 76 deletions

29
dat.h
View File

@@ -18,6 +18,9 @@ enum
LangVI = 0x16,
Fontsz = 32,
PopupPad = 4,
PopupSep = 1,
PopupNumw = Fontsz,
Maxrunes = 64,
Maxutf = Maxrunes * UTFmax + 1,
};
@@ -28,11 +31,13 @@ enum
Maxkouho = 32,
Maxdisp = 9,
Imgw = (Maxrunes + 3) * Fontsz,
Imgh = (Maxdisp + 2) * Fontsz,
Imgh = 2*PopupPad + (Maxdisp + 2)*Fontsz + PopupSep,
Colfg = 0x000000,
Colbg = 0xffffff,
Colsel = 0xcccccc,
Colsep = 0xd0d0d0,
Colsel = 0x333333,
Colselfg = 0xffffff,
};
typedef struct Str Str;
@@ -137,6 +142,26 @@ struct Drawcmd
Caret caret;
};
typedef struct Popup Popup;
struct Popup
{
int w;
int h;
int n;
int prey;
int sepy;
int rowsy;
int numx;
int textx;
int textw;
int markx;
int marky;
int markw;
int selx;
int sely;
int selw;
};
typedef struct Keyreq Keyreq;
typedef struct Keyres Keyres;
enum