From 218529e7ccbcbb4174145f05a62e61a592ec2c30 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sun, 29 Apr 2018 21:01:34 +0200 Subject: Show stylesheet storycode in editor --- src/stylesheet_editor.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/stylesheet_editor.c') diff --git a/src/stylesheet_editor.c b/src/stylesheet_editor.c index 0d9845f..edc5915 100644 --- a/src/stylesheet_editor.c +++ b/src/stylesheet_editor.c @@ -87,6 +87,8 @@ static void set_values_from_presentation(StylesheetEditor *se) PangoFontDescription *fontdesc; double *col; GdkRGBA rgba; + GtkTextBuffer *buf; + char *sc; scin = sc_interp_new(NULL, NULL, NULL, NULL); sc_interp_run_stylesheet(scin, se->priv->p->stylesheet); /* NULL stylesheet is OK */ @@ -104,6 +106,11 @@ static void set_values_from_presentation(StylesheetEditor *se) rgba.alpha = col[3]; gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(se->default_style_fgcol), &rgba); + sc = serialise_sc_block_chain(sc_block_child(se->priv->p->stylesheet)); + buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(se->default_style_ss)); + gtk_text_buffer_set_text(GTK_TEXT_BUFFER(buf), sc, -1); + free(sc); + sc_interp_destroy(scin); } -- cgit v1.2.3