commit 3d9b05bda4b1841953a52c125b7eff3a86773881
parent c415bcbe64735058f98d5401f8cbbed0a8d6e16f
Author: hhvn <dev@hhvn.uk>
Date: Sat, 11 Sep 2021 15:30:39 +0100
config.h dmenu.c: create a Scheme for selected & outputted entries
Diffstat:
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/config.h b/config.h
@@ -17,6 +17,7 @@ static const char *colors[SchemeLast][2] = {
[SchemeNorm] = { "#ffffff", "#050a10" },
[SchemeSel] = { "#ffffff", "#0a2126" },
[SchemeOut] = { "#888888", "#050a10" },
+ [SchemeSelOut] = { "#888888", "#0a2126" },
[SchemeBorder] = { "#ffffff", "#892b2b" },
[SchemeNormHighlight] = { "#aafff0", "#050a10" },
diff --git a/dmenu.c b/dmenu.c
@@ -30,7 +30,8 @@
/* enums */
enum {
- SchemeBorder, SchemeNorm, SchemeSel, SchemeOut,
+ SchemeBorder, SchemeNorm, SchemeSel,
+ SchemeOut, SchemeSelOut,
SchemeSelHighlight, SchemeNormHighlight,
SchemeLast
};
@@ -175,7 +176,9 @@ drawitem(struct item *item, int x, int y, int w)
char *censort;
int ret;
- if (item == sel)
+ if (item->out && item == sel)
+ drw_setscheme(drw, scheme[SchemeSelOut]);
+ else if (item == sel)
drw_setscheme(drw, scheme[SchemeSel]);
else if (item->out)
drw_setscheme(drw, scheme[SchemeOut]);