diff options
author | Thomas White <taw@bitwiz.me.uk> | 2018-04-29 21:01:34 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.me.uk> | 2018-04-29 21:01:34 +0200 |
commit | 218529e7ccbcbb4174145f05a62e61a592ec2c30 (patch) | |
tree | 66f0c5a5c36a8ba7675e08c6d3d5c8049d1855e8 /src | |
parent | 447184ed2c2cdfdc91b36e46b0a46db1e61f29b1 (diff) |
Show stylesheet storycode in editor
Diffstat (limited to 'src')
-rw-r--r-- | src/stylesheet_editor.c | 7 |
1 files changed, 7 insertions, 0 deletions
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); } |