X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=render%2Frender.c;h=804e6c36f4891d8ed578f0f9283c8127c5124f98;hb=7a166a383805f7693e0800f3bf693e3736463a0d;hp=43093effc22d5947f025830151d05cba5e3378d2;hpb=1afb1a7cc85d3f07d47503956dce33cb3f122808;p=chaz%2Fopenbox diff --git a/render/render.c b/render/render.c index 43093eff..804e6c36 100644 --- a/render/render.c +++ b/render/render.c @@ -7,6 +7,7 @@ #include "mask.h" #include "color.h" #include "image.h" +#include "theme.h" #include "kernel/openbox.h" #ifdef HAVE_STDLIB_H @@ -233,20 +234,22 @@ void x_paint(Window win, Appearance *l) for (i = 0; i < l->textures; i++) { tarea = l->texture[i].position; - if (l->surface.data.planar.relief != Flat) { - switch (l->surface.data.planar.bevel) { - case Bevel1: + if (l->surface.data.planar.grad != Background_ParentRelative) { + if (l->surface.data.planar.relief != Flat) { + switch (l->surface.data.planar.bevel) { + case Bevel1: + tarea.x += 1; tarea.y += 1; + tarea.width -= 2; tarea.height -= 2; + break; + case Bevel2: + tarea.x += 2; tarea.y += 2; + tarea.width -= 4; tarea.height -= 4; + break; + } + } else if (l->surface.data.planar.border) { tarea.x += 1; tarea.y += 1; tarea.width -= 2; tarea.height -= 2; - break; - case Bevel2: - tarea.x += 2; tarea.y += 2; - tarea.width -= 4; tarea.height -= 4; - break; } - } else if (l->surface.data.planar.border) { - tarea.x += 1; tarea.y += 1; - tarea.width -= 2; tarea.height -= 2; } switch (l->texture[i].type) { @@ -279,7 +282,7 @@ void x_paint(Window win, Appearance *l) case RGBA: image_draw(l->surface.data.planar.pixel_data, &l->texture[i].data.rgba, - &tarea); + &tarea, &l->area); break; } } @@ -416,47 +419,51 @@ void pixel32_to_pixmap(pixel32 *in, Pixmap out, int x, int y, int w, int h) free(scratch); } -void appearance_minsize(Appearance *l, Size *s) +void appearance_minsize(Appearance *l, int *w, int *h) { int i; - SIZE_SET(*s, 0, 0); + int m; + *w = *h = 1; switch (l->surface.type) { case Surface_Planar: if (l->surface.data.planar.relief != Flat) { switch (l->surface.data.planar.bevel) { case Bevel1: - SIZE_SET(*s, 2, 2); + *w = *h = 2; break; case Bevel2: - SIZE_SET(*s, 4, 4); + *w = *h = 4; break; } } else if (l->surface.data.planar.border) - SIZE_SET(*s, 2, 2); + *w = *h = 2; - for (i = 0; i < l->textures; ++i) + for (i = 0; i < l->textures; ++i) { switch (l->texture[i].type) { case Bitmask: - s->width += l->texture[i].data.mask.mask->w; - s->height += l->texture[i].data.mask.mask->h; + *w += l->texture[i].data.mask.mask->w; + *h += l->texture[i].data.mask.mask->h; break; case Text: - s->width +=font_measure_string(l->texture[i].data.text.font, - l->texture[i].data.text.string, - l->texture[i].data.text.shadow, - l->texture[i].data.text.offset); - s->height += font_height(l->texture[i].data.text.font, - l->texture[i].data.text.shadow, - l->texture[i].data.text.offset); + m = font_measure_string(l->texture[i].data.text.font, + l->texture[i].data.text.string, + l->texture[i].data.text.shadow, + l->texture[i].data.text.offset); + *w += m; + m = font_height(l->texture[i].data.text.font, + l->texture[i].data.text.shadow, + l->texture[i].data.text.offset); + *h += m; break; case RGBA: - s->width += l->texture[i].data.rgba.width; - s->height += l->texture[i].data.rgba.height; + *w += l->texture[i].data.rgba.width; + *h += l->texture[i].data.rgba.height; break; case NoTexture: break; - } + } + } break; } }