summaryrefslogtreecommitdiff
path: root/gui-over.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-09 13:12:10 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-09 13:13:18 -0300
commit5e75b1ef42b1813295c716c32b44babc7121ee06 (patch)
tree380b319cf3be081ee56fa5f0208e9fca1d79d9d7 /gui-over.c
parentb5b269b97bd3ecee3e09d3d6db0da93cc04761ce (diff)
downloadeeshow-5e75b1ef42b1813295c716c32b44babc7121ee06.tar.gz
eeshow-5e75b1ef42b1813295c716c32b44babc7121ee06.tar.bz2
eeshow-5e75b1ef42b1813295c716c32b44babc7121ee06.zip
eeshow/gui-over.c: style is now copied, not just referenced
This way, we can generate styles on the fly and won't have to manage a huge collection of pre-designed styles.
Diffstat (limited to 'gui-over.c')
-rw-r--r--gui-over.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gui-over.c b/gui-over.c
index f54a393..eb2fa94 100644
--- a/gui-over.c
+++ b/gui-over.c
@@ -43,7 +43,7 @@
struct overlay {
const char *s;
- const struct overlay_style *style;
+ struct overlay_style style;
struct aoi **aois;
bool (*hover)(void *user, bool on);
@@ -162,7 +162,7 @@ static void rrect(cairo_t *cr, int x, int y, int w, int h, int r)
struct overlay *overlay_draw(struct overlay *over, cairo_t *cr, int *x, int *y)
{
- const struct overlay_style *style = over->style;
+ const struct overlay_style *style = &over->style;
const double *fg = style->fg;
const double *bg = style->bg;
const double *frame = style->frame;
@@ -293,7 +293,7 @@ struct overlay *overlay_add(struct overlay **overlays, struct aoi **aois,
over = alloc_type(struct overlay);
over->s = NULL;
- over->style = &overlay_style_default;
+ over->style = overlay_style_default;
over->aois = aois;
over->hover = hover;
@@ -311,7 +311,7 @@ struct overlay *overlay_add(struct overlay **overlays, struct aoi **aois,
void overlay_style(struct overlay *over, const struct overlay_style *style)
{
- over->style = style;
+ over->style = *style;
}