From c41736d0dcda90513c57253fd8b2abbbbeb164a3 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Fri, 16 Sep 2022 17:39:17 +0200 Subject: add border and padding --- config.h | 20 +++++++++++--------- pinentry-dmenu | Bin 0 -> 57024 bytes pinentry-dmenu.c | 10 +++++++--- 3 files changed, 18 insertions(+), 12 deletions(-) create mode 100755 pinentry-dmenu diff --git a/config.h b/config.h index 6d64672..fe8022d 100644 --- a/config.h +++ b/config.h @@ -1,21 +1,23 @@ /* See LICENSE file for copyright and license details. */ /* Default settings; can be overriden by command line. */ -static int bottom = 0; +static int bottom = 1; static int embedded = 0; static int minpwlen = 32; static int mon = -1; -static int lineheight = 0; -static int min_lineheight = 8; +static int lineheight = 20; +static int min_lineheight = 20; +static int padding = 10; +static int border_width = 2; -static const char *asterisk = "*"; +static const char *asterisk = "•"; static const char *fonts[] = { - "monospace:size=10" + "SauceCodePro Nerd Font:style=Regular:pixelsize=14" }; static const char *prompt = NULL; static const char *colors[SchemeLast][4] = { - [SchemePrompt] = { "#bbbbbb", "#222222" }, - [SchemeNormal] = { "#bbbbbb", "#222222" }, - [SchemeSelect] = { "#eeeeee", "#005577" }, - [SchemeDesc] = { "#bbbbbb", "#222222" } + [SchemePrompt] = { "#ffffff", "#d85d5d" }, + [SchemeNormal] = { "#888888", "#191919" }, + [SchemeSelect] = { "#ffffff", "#547f62" }, + [SchemeDesc] = { "#ffffff", "#d85d5d" } }; diff --git a/pinentry-dmenu b/pinentry-dmenu new file mode 100755 index 0000000..b294893 Binary files /dev/null and b/pinentry-dmenu differ diff --git a/pinentry-dmenu.c b/pinentry-dmenu.c index 3086b43..aa4adba 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, fh = drw->fonts->h, pb, pbw = 0, i; + int x = 0, fh = drw->fonts->h + 2 * padding, 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 + (bh - fh) / 2, 2, fh - 4, 1, 0); + drw_rect(drw, x + curpos + 2, 2 + (bh - fh) / 2 + padding, 2, fh - 4 - 2 * padding, 1, 0); } free(censort); @@ -265,6 +265,10 @@ drawwin(void) { x = drawitem("Yes", (sel == Yes), x, 0, TEXTW("Yes")); } + drw_setscheme(drw, scheme[SchemePrompt]); + drw_rect(drw, 0, 0, mw, border_width, 1, 1); + drw_rect(drw, 0, bh - border_width, mw, bh, 1, 1); + drw_map(drw, win, 0, 0, mw, mh); } @@ -292,7 +296,7 @@ setup(void) { utf8 = XInternAtom(dpy, "UTF8_STRING", False); /* Calculate menu geometry */ - bh = drw->fonts->h + 2; + bh = drw->fonts->h + padding * 2; bh = MAX(bh, lineheight); mh = bh; #ifdef XINERAMA -- cgit v1.2.3-70-g09d2