fixed vlist select
d77340ed
1 file(s) · +9 −5
| 24 | 24 | static char *cistrstr(const char *s, const char *sub); |
|
| 25 | 25 | static void cleanup(void); |
|
| 26 | 26 | static void dinput(void); |
|
| 27 | + | static void drawitem(char *s, unsigned long col[ColLast]); |
|
| 27 | 28 | static void drawmenuh(void); |
|
| 28 | 29 | static void drawmenuv(void); |
|
| 29 | 30 | static void match(void); |
|
| 155 | 156 | } |
|
| 156 | 157 | ||
| 157 | 158 | void |
|
| 159 | + | drawitem(char *s, unsigned long col[ColLast]) { |
|
| 160 | + | drawbox(&dc, col); |
|
| 161 | + | drawtext(&dc, s, col); |
|
| 162 | + | } |
|
| 163 | + | ||
| 164 | + | void |
|
| 158 | 165 | drawmenuh(void) { |
|
| 159 | - | unsigned long *col; |
|
| 160 | 166 | Item *i; |
|
| 161 | 167 | ||
| 162 | 168 | dc.x += cmdw; |
|
| 165 | 171 | dc.x += dc.w; |
|
| 166 | 172 | for(i = curr; i != next; i = i->right) { |
|
| 167 | 173 | dc.w = MIN(textw(&dc, i->text), mw / 3); |
|
| 168 | - | col = (sel == i) ? selcol : normcol; |
|
| 169 | - | drawbox(&dc, col); |
|
| 170 | - | drawtext(&dc, i->text, col); |
|
| 174 | + | drawitem(i->text, (sel == i) ? selcol : normcol); |
|
| 171 | 175 | dc.x += dc.w; |
|
| 172 | 176 | } |
|
| 173 | 177 | dc.w = textw(&dc, ">"); |
|
| 183 | 187 | dc.y = topbar ? dc.h : 0; |
|
| 184 | 188 | dc.w = mw - dc.x; |
|
| 185 | 189 | for(i = curr; i != next; i = i->right) { |
|
| 186 | - | drawtext(&dc, i->text, (sel == i) ? selcol : normcol); |
|
| 190 | + | drawitem(i->text, (sel == i) ? selcol : normcol); |
|
| 187 | 191 | dc.y += dc.h; |
|
| 188 | 192 | } |
|
| 189 | 193 | if(!XGetWindowAttributes(dpy, win, &wa)) |
|