popup: follow GDK_SCALE on HiDPI
The popup was 32-pixel rows whatever the display; next to 2x application text it was small. Its metrics now scale with the daemon's GDK_SCALE, the setting the applications use.
This commit is contained in:
17
dat.h
17
dat.h
@@ -18,12 +18,6 @@ enum
|
||||
LangEMOJI = 0x05,
|
||||
LangVI = 0x16,
|
||||
|
||||
Fontsz = 32,
|
||||
PopupPad = 4,
|
||||
PopupSep = 1,
|
||||
PopupNumw = Fontsz,
|
||||
PopupTextw = 12*Fontsz,
|
||||
PopupBasew = 2*PopupPad + PopupNumw + PopupTextw,
|
||||
Maxrunes = 64,
|
||||
Maxutf = Maxrunes * UTFmax + 1,
|
||||
};
|
||||
@@ -33,7 +27,6 @@ enum
|
||||
Maxclients = 64,
|
||||
Maxkouho = 128,
|
||||
Maxdisp = 9,
|
||||
Imgh = 2*PopupPad + (Maxdisp + 2)*Fontsz + PopupSep,
|
||||
|
||||
Colfg = 0x000000,
|
||||
Colbg = 0xffffff,
|
||||
@@ -42,6 +35,16 @@ enum
|
||||
Colselfg = 0xffffff,
|
||||
};
|
||||
|
||||
/* Popup metrics in pixels; popupscale is GDK_SCALE, for HiDPI. */
|
||||
extern int popupscale;
|
||||
#define Fontsz (32*popupscale)
|
||||
#define PopupPad (4*popupscale)
|
||||
#define PopupSep popupscale
|
||||
#define PopupNumw Fontsz
|
||||
#define PopupTextw (12*Fontsz)
|
||||
#define PopupBasew (2*PopupPad + PopupNumw + PopupTextw)
|
||||
#define Imgh (2*PopupPad + (Maxdisp + 2)*Fontsz + PopupSep)
|
||||
|
||||
typedef struct Str Str;
|
||||
struct Str
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user