mirror of
https://github.com/0intro/wmii
synced 2025-01-11 12:49:38 +03:00
nicer frame drawing
This commit is contained in:
parent
33ad150558
commit
babe3af6e2
16
draw.c
16
draw.c
@ -74,7 +74,13 @@ labelh(BlitzFont *font) {
|
||||
void
|
||||
draw_tile(BlitzBrush *b) {
|
||||
drawbg(b->blitz->dpy, b->drawable, b->gc, b->rect,
|
||||
b->color, b->border);
|
||||
b->color, True, b->border);
|
||||
}
|
||||
|
||||
void
|
||||
draw_border(BlitzBrush *b) {
|
||||
drawbg(b->blitz->dpy, b->drawable, b->gc, b->rect,
|
||||
b->color, False, True);
|
||||
}
|
||||
|
||||
void
|
||||
@ -132,11 +138,13 @@ draw_label(BlitzBrush *b, char *text) {
|
||||
|
||||
void
|
||||
drawbg(Display *dpy, Drawable drawable, GC gc, XRectangle rect,
|
||||
BlitzColor c, Bool border)
|
||||
BlitzColor c, Bool fill, Bool border)
|
||||
{
|
||||
XPoint points[5];
|
||||
XSetForeground(dpy, gc, c.bg);
|
||||
XFillRectangles(dpy, drawable, gc, &rect, 1);
|
||||
if(fill) {
|
||||
XSetForeground(dpy, gc, c.bg);
|
||||
XFillRectangles(dpy, drawable, gc, &rect, 1);
|
||||
}
|
||||
if(!border)
|
||||
return;
|
||||
XSetLineAttributes(dpy, gc, 1, LineSolid, CapButt, JoinMiter);
|
||||
|
1
frame.c
1
frame.c
@ -85,6 +85,7 @@ draw_frame(Frame *f) {
|
||||
draw_tile(&f->tile);
|
||||
draw_tile(&f->grabbox);
|
||||
draw_label(&f->titlebar, f->client->name);
|
||||
draw_border(&f->tile);
|
||||
XCopyArea(blz.dpy, pmap, f->client->framewin, f->client->gc,
|
||||
0, 0, f->rect.width, f->rect.height, 0, 0);
|
||||
XSync(blz.dpy, False);
|
||||
|
3
wmii.h
3
wmii.h
@ -297,9 +297,10 @@ extern Area *new_column(View *v, Area *pos, unsigned int w);
|
||||
extern int loadcolor(Blitz *blitz, BlitzColor *c);
|
||||
extern void draw_label(BlitzBrush *b, char *text);
|
||||
extern void draw_tile(BlitzBrush *b);
|
||||
extern void draw_rect(BlitzBrush *b);
|
||||
|
||||
extern void drawbg(Display *dpy, Drawable drawable, GC gc,
|
||||
XRectangle rect, BlitzColor c, Bool border);
|
||||
XRectangle rect, BlitzColor c, Bool fill, Bool border);
|
||||
extern void drawcursor(Display *dpy, Drawable drawable, GC gc,
|
||||
int x, int y, unsigned int h, BlitzColor c);
|
||||
extern unsigned int textwidth(BlitzFont *font, char *text);
|
||||
|
Loading…
Reference in New Issue
Block a user