diff options
author | Thomas White <taw@bitwiz.org.uk> | 2018-01-05 10:28:56 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2018-01-05 10:28:56 +0100 |
commit | d11a7e62862a448fb7451c0345a11cac463ae780 (patch) | |
tree | 3c99f653d234e2857877eef84032ea2559f96ba7 | |
parent | 02828602d6f2f1ec2a7e718dea8d4bedc9dc300d (diff) |
GUI slide title adding
-rw-r--r-- | src/colloquium.c | 4 | ||||
-rw-r--r-- | src/sc_editor.c | 9 | ||||
-rw-r--r-- | src/sc_editor.h | 1 | ||||
-rw-r--r-- | src/slide_window.c | 9 |
4 files changed, 23 insertions, 0 deletions
diff --git a/src/colloquium.c b/src/colloquium.c index 001786c..422a231 100644 --- a/src/colloquium.c +++ b/src/colloquium.c @@ -348,6 +348,10 @@ static void colloquium_startup(GApplication *papp) " <attribute name='label'>Slide</attribute>" " <attribute name='action'>win.slide</attribute>" " </item>" + " <item>" + " <attribute name='label'>Slide title</attribute>" + " <attribute name='action'>win.slidetitle</attribute>" + " </item>" " </section>" " </submenu>" diff --git a/src/sc_editor.c b/src/sc_editor.c index fa86706..f486598 100644 --- a/src/sc_editor.c +++ b/src/sc_editor.c @@ -453,6 +453,15 @@ void sc_editor_paste(SCEditor *e) } +void sc_editor_add_storycode(SCEditor *e, const char *sc) +{ + SCBlock *nf; + nf = sc_parse(sc); + sc_block_append_block(e->scblocks, nf); + full_rerender(e); +} + + void sc_editor_copy_selected_frame(SCEditor *e) { char *t; diff --git a/src/sc_editor.h b/src/sc_editor.h index 9996834..ad894f4 100644 --- a/src/sc_editor.h +++ b/src/sc_editor.h @@ -187,6 +187,7 @@ extern void sc_editor_set_top_frame_editable(SCEditor *e, int top_frame_editable); extern void sc_editor_set_callbacks(SCEditor *e, SCCallbackList *cbl); extern void sc_editor_paste(SCEditor *e); +extern void sc_editor_add_storycode(SCEditor *e, const char *sc); extern void sc_editor_copy_selected_frame(SCEditor *e); extern void sc_editor_delete_selected_frame(SCEditor *e); extern void sc_editor_remove_cursor(SCEditor *e); diff --git a/src/slide_window.c b/src/slide_window.c index ae89062..283e96e 100644 --- a/src/slide_window.c +++ b/src/slide_window.c @@ -75,6 +75,14 @@ struct menu_pl }; +static void insert_slidetitle_sig(GSimpleAction *action, GVariant *parameter, + gpointer vp) +{ + SlideWindow *sw = vp; + sc_editor_add_storycode(sw->sceditor, "\\slidetitle{Slide title}"); +} + + static void paste_sig(GSimpleAction *action, GVariant *parameter, gpointer vp) { @@ -219,6 +227,7 @@ GActionEntry sw_entries[] = { { "prev", prev_slide_sig, NULL, NULL, NULL }, { "next", next_slide_sig, NULL, NULL, NULL }, { "last", last_slide_sig, NULL, NULL, NULL }, + { "slidetitle", insert_slidetitle_sig, NULL, NULL, NULL }, }; |