[hackers] [dmenu] underline match || Connor Lane Smith

From: <hg_AT_suckless.org>
Date: Fri, 30 Jul 2010 09:26:34 +0000 (UTC)

changeset: 341:5babc1f53685
tag: tip
user: Connor Lane Smith <cls_AT_lubutu.com>
date: Fri Jul 30 10:26:12 2010 +0100
files: dmenu.c
description:
underline match

diff -r f6cbb17a83ea -r 5babc1f53685 dmenu.c
--- a/dmenu.c Fri Jul 30 10:25:55 2010 +0100
+++ b/dmenu.c Fri Jul 30 10:26:12 2010 +0100
@@ -158,8 +158,13 @@
 
 void
 drawitem(const char *s, unsigned long col[ColLast]) {
+ const char *p;
+ unsigned int w = textnw(&dc, text, strlen(text));
+
         drawbox(&dc, col);
         drawtext(&dc, s, col);
+ for(p = fstrstr(s, text); *text && (p = fstrstr(p, text)); p++)
+ drawline(&dc, textnw(&dc, s, p-s) + dc.h/2 - 1, dc.h-2, w, 1, col);
 }
 
 void
Received on Fri Jul 30 2010 - 11:26:34 CEST

This archive was generated by hypermail 2.2.0 : Fri Jul 30 2010 - 11:36:05 CEST