From 75ac1e869e551495c403cf94a3a24dd0dfee98ef Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 5 Dec 2020 17:07:12 -0800 Subject: [PATCH] psppire-output-view: Consistently apply "transparent" and "systemcolors". Commit 81dece3642da ("output view: make items selectable and use system colours") add transparency and system colors to the driver in the GUI, but it did so somewhat after the driver was created. I don't know why. It makes more sense to me to set these options when creating the driver. This commit makes that change. It also deletes the function to change the options; it had no other user. --- src/output/cairo.c | 7 ------- src/output/cairo.h | 1 - src/ui/gui/psppire-output-view.c | 8 +++----- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/output/cairo.c b/src/output/cairo.c index ae6e767603..c7b14ff68c 100644 --- a/src/output/cairo.c +++ b/src/output/cairo.c @@ -1612,13 +1612,6 @@ xr_rendering_create_text (struct xr_driver *xr, const char *text, cairo_t *cr) return r; } -void -xr_rendering_apply_options (struct xr_rendering *xr, struct string_map *o) -{ - if (is_table_item (xr->item)) - apply_options (xr->xr, o); -} - struct xr_rendering * xr_rendering_create (struct xr_driver *xr, const struct output_item *item, cairo_t *cr) diff --git a/src/output/cairo.h b/src/output/cairo.h index 0570479f96..7afd1fe660 100644 --- a/src/output/cairo.h +++ b/src/output/cairo.h @@ -42,7 +42,6 @@ struct xr_rendering *xr_rendering_create (struct xr_driver *, cairo_t *); void xr_rendering_destroy (struct xr_rendering *); -void xr_rendering_apply_options (struct xr_rendering *, struct string_map *o); void xr_rendering_measure (const struct xr_rendering *, int *w, int *h); void xr_rendering_draw (struct xr_rendering *r, cairo_t *cr, int x0, int y0, int x1, int y1); diff --git a/src/ui/gui/psppire-output-view.c b/src/ui/gui/psppire-output-view.c index 4296409120..0527209ec0 100644 --- a/src/ui/gui/psppire-output-view.c +++ b/src/ui/gui/psppire-output-view.c @@ -174,6 +174,9 @@ get_xr_options (struct psppire_output_view *view, struct string_map *options) string_map_insert (options, "right-margin", "0"); string_map_insert (options, "top-margin", "0"); string_map_insert (options, "bottom-margin", "0"); + + string_map_insert (options, "transparent", "true"); + string_map_insert (options, "systemcolors", "true"); } static void @@ -310,11 +313,6 @@ create_drawing_area (struct psppire_output_view *view, GtkWidget *drawing_area, struct xr_rendering *r, int tw, int th, const struct output_item *item) { - struct string_map options = STRING_MAP_INITIALIZER (options); - string_map_insert (&options, "transparent", "true"); - string_map_insert (&options, "systemcolors", "true"); - xr_rendering_apply_options (r, &options); - g_object_set_data_full (G_OBJECT (drawing_area), "rendering", r, free_rendering); g_signal_connect (drawing_area, "button-press-event", -- 2.30.2