summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-10-22 12:04:57 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-10-22 12:04:57 (GMT)
commit7fcc2dd58e4df3cf4d52f451371d7d550a155b01 (patch)
tree8ad11735e0534c6d9fcfc7e6372afcf9e0ea8eab /gui
parent7c16c6f9774949e1b638b99e3c6ae6e570385e45 (diff)
downloadeeshow-7fcc2dd58e4df3cf4d52f451371d7d550a155b01.zip
eeshow-7fcc2dd58e4df3cf4d52f451371d7d550a155b01.tar.gz
eeshow-7fcc2dd58e4df3cf4d52f451371d7d550a155b01.tar.bz2
gui/over.c (overlay_draw, overlay_size): support overlays without content
Diffstat (limited to 'gui')
-rw-r--r--gui/over.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/gui/over.c b/gui/over.c
index b321368..a6aabe9 100644
--- a/gui/over.c
+++ b/gui/over.c
@@ -258,10 +258,19 @@ static unsigned overlay_draw_icon(struct overlay *over, cairo_t *cr,
unsigned overlay_draw(struct overlay *over, cairo_t *cr,
int x, int y, int dx, int dy)
{
+ const struct overlay_style *style = &over->style;
+ unsigned w, h;
+
if (over->s)
return overlay_draw_text(over, cr, x, y, dx, dy);
- else
+ if (over->icon)
return overlay_draw_icon(over, cr, x, y, dx, dy);
+
+ w = style->wmin + 2 * style->pad;
+ h = style->hmin + 2 * style->pad;
+ background(over, cr, x, y, w, h);
+ post_aoi(over, x, y, w, h);
+ return h;
}
@@ -384,10 +393,18 @@ static void overlay_size_icon(const struct overlay *over, int *w, int *h)
void overlay_size(const struct overlay *over, PangoContext *pango_context,
int *w, int *h)
{
+ const struct overlay_style *style = &over->style;
+
if (over->s)
overlay_size_text(over, pango_context, w, h);
- else
+ else if (over->icon)
overlay_size_icon(over, w, h);
+ else {
+ if (w)
+ *w = style->wmin + 2 * style->pad;
+ if (h)
+ *h = style->hmin + 2 * style->pad;
+ }
}