#include "mask.h"
#include "color.h"
#include "image.h"
+#include "theme.h"
#include "kernel/openbox.h"
#ifdef HAVE_STDLIB_H
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) {
case RGBA:
image_draw(l->surface.data.planar.pixel_data,
&l->texture[i].data.rgba,
- &tarea);
+ &tarea, &l->area);
break;
}
}
void appearance_minsize(Appearance *l, int *w, int *h)
{
int i;
+ int m;
*w = *h = 1;
switch (l->surface.type) {
} else if (l->surface.data.planar.border)
*w = *h = 2;
- for (i = 0; i < l->textures; ++i)
+ for (i = 0; i < l->textures; ++i) {
switch (l->texture[i].type) {
case Bitmask:
*w += l->texture[i].data.mask.mask->w;
*h += l->texture[i].data.mask.mask->h;
break;
case Text:
- *w +=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);
- *h += 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:
*w += l->texture[i].data.rgba.width;
break;
case NoTexture:
break;
- }
+ }
+ }
break;
}
}