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