drawsquare is now drawrectangle
This commit is contained in:
parent
3c6e7fa6de
commit
f6ea98649c
6
draw.c
6
draw.c
|
@ -71,7 +71,7 @@ drawtext(Display *disp, int screen, int x, int y, int w, int h, GC gc, Drawable
|
|||
}
|
||||
|
||||
void
|
||||
drawsquare(Display *disp, int screen, int x, int y, int h, Drawable drawable, int dw, int dh, Bool filled, XColor color)
|
||||
drawrectangle(Display *disp, int screen, int x, int y, int w, int h, Drawable drawable, int dw, int dh, Bool filled, XColor color)
|
||||
{
|
||||
cairo_surface_t *surface;
|
||||
cairo_t *cr;
|
||||
|
@ -84,11 +84,11 @@ drawsquare(Display *disp, int screen, int x, int y, int h, Drawable drawable, in
|
|||
cairo_set_source_rgb(cr, color.red, color.green, color.blue);
|
||||
if(filled)
|
||||
{
|
||||
cairo_rectangle(cr, x + 1, y + 1, h + 1, h + 1);
|
||||
cairo_rectangle(cr, x + 1, y + 1, w + 1, h + 1);
|
||||
cairo_fill(cr);
|
||||
}
|
||||
else
|
||||
cairo_rectangle(cr, x + 1, y + 1, h, h);
|
||||
cairo_rectangle(cr, x + 1, y + 1, w, h);
|
||||
cairo_stroke(cr);
|
||||
|
||||
cairo_destroy(cr);
|
||||
|
|
2
draw.h
2
draw.h
|
@ -25,6 +25,6 @@
|
|||
#include "config.h"
|
||||
|
||||
void drawtext(Display *, int, int, int, int, int, GC, Drawable, XftFont *, const char *, XColor []);
|
||||
void drawsquare(Display *, int, int, int, int, Drawable, int, int, Bool, XColor);
|
||||
void drawrectangle(Display *, int, int, int, int, int, Drawable, int, int, Bool, XColor);
|
||||
inline unsigned short textwidth(Display *, XftFont *, char *, ssize_t);
|
||||
#endif
|
||||
|
|
48
statusbar.c
48
statusbar.c
|
@ -70,13 +70,15 @@ drawstatusbar(Display *disp, awesome_config * awesomeconf)
|
|||
awesomeconf->statusbar.drawable, awesomeconf->font,
|
||||
awesomeconf->tags[i].name, awesomeconf->colors_selected);
|
||||
if(isoccupied(i, awesomeconf->screen))
|
||||
drawsquare(disp, awesomeconf->phys_screen,
|
||||
x, y, (awesomeconf->font->height + 2) / 4,
|
||||
awesomeconf->statusbar.drawable,
|
||||
awesomeconf->statusbar.width,
|
||||
awesomeconf->statusbar.height,
|
||||
sel && sel->tags[i],
|
||||
awesomeconf->colors_selected[ColFG]);
|
||||
drawrectangle(disp, awesomeconf->phys_screen,
|
||||
x, y,
|
||||
(awesomeconf->font->height + 2) / 4,
|
||||
(awesomeconf->font->height + 2) / 4,
|
||||
awesomeconf->statusbar.drawable,
|
||||
awesomeconf->statusbar.width,
|
||||
awesomeconf->statusbar.height,
|
||||
sel && sel->tags[i],
|
||||
awesomeconf->colors_selected[ColFG]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -86,13 +88,15 @@ drawstatusbar(Display *disp, awesome_config * awesomeconf)
|
|||
awesomeconf->statusbar.drawable, awesomeconf->font,
|
||||
awesomeconf->tags[i].name, awesomeconf->colors_normal);
|
||||
if(isoccupied(i, awesomeconf->screen))
|
||||
drawsquare(disp, awesomeconf->phys_screen,
|
||||
x, y, (awesomeconf->font->height + 2) / 4,
|
||||
awesomeconf->statusbar.drawable,
|
||||
awesomeconf->statusbar.width,
|
||||
awesomeconf->statusbar.height,
|
||||
sel && sel->tags[i],
|
||||
awesomeconf->colors_normal[ColFG]);
|
||||
drawrectangle(disp, awesomeconf->phys_screen,
|
||||
x, y,
|
||||
(awesomeconf->font->height + 2) / 4,
|
||||
(awesomeconf->font->height + 2) / 4,
|
||||
awesomeconf->statusbar.drawable,
|
||||
awesomeconf->statusbar.width,
|
||||
awesomeconf->statusbar.height,
|
||||
sel && sel->tags[i],
|
||||
awesomeconf->colors_normal[ColFG]);
|
||||
}
|
||||
x += w;
|
||||
}
|
||||
|
@ -126,13 +130,15 @@ drawstatusbar(Display *disp, awesome_config * awesomeconf)
|
|||
awesomeconf->statusbar.drawable, awesomeconf->font,
|
||||
sel->name, awesomeconf->colors_selected);
|
||||
if(sel->isfloating)
|
||||
drawsquare(disp, awesomeconf->phys_screen,
|
||||
x, y, (awesomeconf->font->height + 2) / 4,
|
||||
awesomeconf->statusbar.drawable,
|
||||
awesomeconf->statusbar.width,
|
||||
awesomeconf->statusbar.height,
|
||||
sel->ismax,
|
||||
awesomeconf->colors_selected[ColFG]);
|
||||
drawrectangle(disp, awesomeconf->phys_screen,
|
||||
x, y,
|
||||
(awesomeconf->font->height + 2) / 4,
|
||||
(awesomeconf->font->height + 2) / 4,
|
||||
awesomeconf->statusbar.drawable,
|
||||
awesomeconf->statusbar.width,
|
||||
awesomeconf->statusbar.height,
|
||||
sel->ismax,
|
||||
awesomeconf->colors_selected[ColFG]);
|
||||
}
|
||||
else if(IS_ARRANGE(0, layout_tile) || IS_ARRANGE(0, layout_tileleft))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue