aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-01-25 19:50:55 +0100
committerThomas White <taw@physics.org>2020-01-25 19:50:55 +0100
commit228d79788db288ff108986a59f560c0bf80b0804 (patch)
treef938416391b85010880fe2b282a5f364d5c7db80
parent59af8b8e097eef472a3207bc5a8ed903c43951ae (diff)
Implement Slide->Add presentation title
-rw-r--r--src/slide_window.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/slide_window.c b/src/slide_window.c
index dc5ce9a..c4aa948 100644
--- a/src/slide_window.c
+++ b/src/slide_window.c
@@ -74,6 +74,25 @@ static void insert_slidetitle_sig(GSimpleAction *action, GVariant *parameter,
}
+static void insert_prestitle_sig(GSimpleAction *action, GVariant *parameter,
+ gpointer vp)
+{
+ SlideItem *item;
+ SlideWindow *sw = vp;
+ struct text_run *runs;
+ int nruns = 1;
+
+ /* Ownership of this struct will be taken over by the Slide. */
+ runs = malloc(sizeof(struct text_run));
+ runs[0].type = TEXT_RUN_NORMAL;
+ runs[0].text = strdup("Presentation title");
+
+ item = slide_item_prestitle(&runs, &nruns, 1);
+ item = slide_add_item(sw->slide, item);
+ gtk_slide_view_set_slide(sw->sv, sw->slide);
+}
+
+
static gint insert_image_response_sig(GtkWidget *d, gint response, SlideWindow *sw)
{
GtkWidget *cb;
@@ -303,6 +322,7 @@ GActionEntry sw_entries[] = {
{ "next", next_slide_sig, NULL, NULL, NULL },
{ "last", last_slide_sig, NULL, NULL, NULL },
{ "slidetitle", insert_slidetitle_sig, NULL, NULL, NULL },
+ { "prestitle", insert_prestitle_sig, NULL, NULL, NULL },
{ "image", insert_image_sig, NULL, NULL, NULL },
};