diff options
author | Thomas White <taw@bitwiz.me.uk> | 2018-05-01 22:12:22 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.me.uk> | 2018-05-01 22:12:22 +0200 |
commit | 072516c65a7335cc168e6ecc9b5a0737c9842913 (patch) | |
tree | 9390bd7da99406258fa4ec2b6f88e8a01cab1fe5 /src/stylesheet_editor.c | |
parent | ebe339f9f26287216d8e6bc969ef3eaba7377e5c (diff) |
Get rid of stylesheet lists and add stylesheet change signal
We no longer have a need for more than one (since the callback stuff
changed, see 61394e51), and removing it makes it much easier to hook up
the stylesheet update code for the stylesheet editor.
Diffstat (limited to 'src/stylesheet_editor.c')
-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 66644f6..6dee835 100644 --- a/src/stylesheet_editor.c +++ b/src/stylesheet_editor.c @@ -58,6 +58,8 @@ static void set_ss(struct presentation *p, const char *find, const char *seti) fprintf(stderr, "WARNING: Couldn't create stylesheet\n"); return; } + sc_block_append_p(p->stylesheet, p->scblocks); + p->scblocks = p->stylesheet; } bl = p->stylesheet; @@ -97,6 +99,7 @@ static void default_font_sig(GtkFontButton *widget, StylesheetEditor *se) font = gtk_font_button_get_font_name(GTK_FONT_BUTTON(widget)); set_ss(se->priv->p, "font", font); set_values_from_presentation(se); + g_signal_emit_by_name(se, "changed"); } @@ -109,6 +112,7 @@ static void default_colour_sig(GtkColorButton *widget, StylesheetEditor *se) set_ss(se->priv->p, "fgcol", col); g_free(col); set_values_from_presentation(se); + g_signal_emit_by_name(se, "changed"); } @@ -140,6 +144,9 @@ void stylesheet_editor_class_init(StylesheetEditorClass *klass) gtk_widget_class_bind_template_callback(widget_class, revert_sig); gtk_widget_class_bind_template_callback(widget_class, default_font_sig); gtk_widget_class_bind_template_callback(widget_class, default_colour_sig); + + g_signal_new("changed", COLLOQUIUM_TYPE_STYLESHEET_EDITOR, + G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 0); } |