aboutsummaryrefslogtreecommitdiff
path: root/pinentry-dmenu.c
diff options
context:
space:
mode:
authorMoritz Lüdecke <moritz.luedecke@skweez.net>2022-08-11 11:22:10 +0200
committerGitHub <noreply@github.com>2022-08-11 11:22:10 +0200
commit07617d3e3239dcc1f7c75c0eae5af9645a57d1da (patch)
tree278d4485b7e094afe7c048b04dae4a8990d15217 /pinentry-dmenu.c
parenta4f7d150c7395faf72fb167ac333170668124866 (diff)
parent0fb97fbc49fd3c324b12256f476badaeecd1a2ff (diff)
Merge pull request #10 from vaygr/lineheight-support
Add lineheight support
Diffstat (limited to 'pinentry-dmenu.c')
-rw-r--r--pinentry-dmenu.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/pinentry-dmenu.c b/pinentry-dmenu.c
index 453a350..3086b43 100644
--- a/pinentry-dmenu.c
+++ b/pinentry-dmenu.c
@@ -183,7 +183,7 @@ insert(const char *str, ssize_t n) {
static void
drawwin(void) {
unsigned int curpos;
- int x = 0, pb, pbw = 0, i;
+ int x = 0, fh = drw->fonts->h, pb, pbw = 0, i;
size_t asterlen = strlen(asterisk);
size_t pdesclen;
int leftinput;
@@ -255,7 +255,7 @@ drawwin(void) {
if ((curpos += lrpad / 2 - 1) < leftinput) {
drw_setscheme(drw, scheme[SchemeNormal]);
- drw_rect(drw, x + curpos, 2, 2, bh - 4, 1, 0);
+ drw_rect(drw, x + curpos, 2 + (bh - fh) / 2, 2, fh - 4, 1, 0);
}
free(censort);
@@ -293,6 +293,7 @@ setup(void) {
/* Calculate menu geometry */
bh = drw->fonts->h + 2;
+ bh = MAX(bh, lineheight);
mh = bh;
#ifdef XINERAMA
info = XineramaQueryScreens(dpy, &n);
@@ -744,6 +745,9 @@ main(int argc, char *argv[]) {
if (config_lookup_int(&cfg, "min_password_length", &val)) {
minpwlen = val;
}
+ if (config_lookup_int(&cfg, "height", &val)) {
+ lineheight = MAX(val, min_lineheight);
+ }
if (config_lookup_int(&cfg, "monitor", &val)) {
mon = val;
}