draw.c
changeset 124 75576e44c1d8
parent 123 61490330e90a
child 142 9b9deafa0508
equal deleted inserted replaced
123:61490330e90a 124:75576e44c1d8
   105 }
   105 }
   106 
   106 
   107 void
   107 void
   108 drawstatus()
   108 drawstatus()
   109 {
   109 {
   110 	int i;
   110 	int i, x;
   111 	Bool istile = arrange == dotile;
   111 	Bool istile = arrange == dotile;
   112 
   112 
   113 	dc.x = dc.y = 0;
   113 	dc.x = dc.y = 0;
   114 	dc.w = bw;
   114 	dc.w = bw;
   115 	drawtext(NULL, !istile, False);
   115 	drawtext(NULL, !istile, False);
   121 		if(istile)
   121 		if(istile)
   122 			drawtext(tags[i], (i == tsel), True);
   122 			drawtext(tags[i], (i == tsel), True);
   123 		else
   123 		else
   124 			drawtext(tags[i], (i != tsel), True);
   124 			drawtext(tags[i], (i != tsel), True);
   125 	}
   125 	}
   126 	if(sel) {
   126 	x = dc.x + dc.w;
   127 		dc.x += dc.w;
       
   128 		dc.w = textw(sel->name);
       
   129 		drawtext(sel->name, istile, True);
       
   130 	}
       
   131 	dc.w = textw(stext);
   127 	dc.w = textw(stext);
   132 	dc.x = bx + bw - dc.w;
   128 	dc.x = bx + bw - dc.w;
   133 	drawtext(stext, !istile, False);
   129 	drawtext(stext, !istile, False);
   134 
   130 	if(sel && ((dc.w = dc.x - x) >= bh)) {
       
   131 		dc.x = x;
       
   132 		drawtext(sel->name, istile, True);
       
   133 	}
   135 	XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, bw, bh, 0, 0);
   134 	XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, bw, bh, 0, 0);
   136 	XSync(dpy, False);
   135 	XSync(dpy, False);
   137 }
   136 }
   138 
   137 
   139 void
   138 void