psppire-output-view: Consistently apply "transparent" and "systemcolors".
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 6 Dec 2020 01:07:12 +0000 (17:07 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 13 Dec 2020 19:25:12 +0000 (11:25 -0800)
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
src/output/cairo.h
src/ui/gui/psppire-output-view.c

index 03d090ba8ed26a5c0f1101caf0b9a5ba17581530..e619088fa41ed00a3985cda38a0d2e3d441a8e54 100644 (file)
@@ -1615,13 +1615,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)
index 0570479f964233b5e911577a5c07841b2e6f92ee..7afd1fe660d59c674708533917e9ce5aa13b538e 100644 (file)
@@ -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);
index 4296409120214f545149f0920cb60ea6f2865841..0527209ec09ecbabf8e95099a3df1e833bca3567 100644 (file)
@@ -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",