Browse Source

new libdraw

master
Connor Lane Smith 15 years ago
parent
commit
115c01b74e
  1. 4
      dinput.c
  2. 5
      dmenu.c

4
dinput.c

@ -34,12 +34,14 @@ drawbar(void)
/* print prompt? */ /* print prompt? */
if(prompt) { if(prompt) {
dc.w = promptw; dc.w = promptw;
drawbox(&dc, selcol);
drawtext(&dc, prompt, selcol); drawtext(&dc, prompt, selcol);
dc.x += dc.w; dc.x += dc.w;
} }
dc.w = mw - dc.x; dc.w = mw - dc.x;
drawtext(&dc, text, normcol); drawtext(&dc, text, normcol);
drawcursor(&dc, text, cursor, normcol); drawline(&dc, textnw(&dc, text, cursor) + dc.font.height/2, 2, 1,
dc.font.height-2, normcol);
commitdraw(&dc, win); commitdraw(&dc, win);
} }

5
dmenu.c

@ -24,7 +24,7 @@ static void calcoffsetsv(void);
static char *cistrstr(const char *s, const char *sub); static char *cistrstr(const char *s, const char *sub);
static void cleanup(void); static void cleanup(void);
static void dinput(void); static void dinput(void);
static void drawitem(char *s, unsigned long col[ColLast]); static void drawitem(const char *s, unsigned long col[ColLast]);
static void drawmenuh(void); static void drawmenuh(void);
static void drawmenuv(void); static void drawmenuv(void);
static void match(void); static void match(void);
@ -140,6 +140,7 @@ drawbar(void) {
/* print prompt? */ /* print prompt? */
if(prompt) { if(prompt) {
dc.w = promptw; dc.w = promptw;
drawbox(&dc, selcol);
drawtext(&dc, prompt, selcol); drawtext(&dc, prompt, selcol);
dc.x += dc.w; dc.x += dc.w;
} }
@ -156,7 +157,7 @@ drawbar(void) {
} }
void void
drawitem(char *s, unsigned long col[ColLast]) { drawitem(const char *s, unsigned long col[ColLast]) {
drawbox(&dc, col); drawbox(&dc, col);
drawtext(&dc, s, col); drawtext(&dc, s, col);
} }

Loading…
Cancel
Save