[hackers] [dmenu] fixed vlist select || Connor Lane Smith

From: <hg_AT_suckless.org>
Date: Fri, 30 Jul 2010 08:18:54 +0000 (UTC)

changeset: 339:872ed8504d6b
tag: tip
user: Connor Lane Smith <cls_AT_lubutu.com>
date: Fri Jul 30 09:18:35 2010 +0100
files: dmenu.c
description:
fixed vlist select

diff -r 9774212f4b4b -r 872ed8504d6b dmenu.c
--- a/dmenu.c Tue Jul 27 13:40:32 2010 +0100
+++ b/dmenu.c Fri Jul 30 09:18:35 2010 +0100
@@ -24,6 +24,7 @@
 static char *cistrstr(const char *s, const char *sub);
 static void cleanup(void);
 static void dinput(void);
+static void drawitem(char *s, unsigned long col[ColLast]);
 static void drawmenuh(void);
 static void drawmenuv(void);
 static void match(void);
@@ -155,8 +156,13 @@
 }
 
 void
+drawitem(char *s, unsigned long col[ColLast]) {
+ drawbox(&dc, col);
+ drawtext(&dc, s, col);
+}
+
+void
 drawmenuh(void) {
- unsigned long *col;
         Item *i;
 
         dc.x += cmdw;
@@ -165,9 +171,7 @@
         dc.x += dc.w;
         for(i = curr; i != next; i = i->right) {
                 dc.w = MIN(textw(&dc, i->text), mw / 3);
- col = (sel == i) ? selcol : normcol;
- drawbox(&dc, col);
- drawtext(&dc, i->text, col);
+ drawitem(i->text, (sel == i) ? selcol : normcol);
                 dc.x += dc.w;
         }
         dc.w = textw(&dc, ">");
@@ -183,7 +187,7 @@
         dc.y = topbar ? dc.h : 0;
         dc.w = mw - dc.x;
         for(i = curr; i != next; i = i->right) {
- drawtext(&dc, i->text, (sel == i) ? selcol : normcol);
+ drawitem(i->text, (sel == i) ? selcol : normcol);
                 dc.y += dc.h;
         }
         if(!XGetWindowAttributes(dpy, win, &wa))
Received on Fri Jul 30 2010 - 10:18:54 CEST

This archive was generated by hypermail 2.2.0 : Fri Jul 30 2010 - 10:24:04 CEST