diff options
-rw-r--r-- | src/narrative_window.c | 1 | ||||
-rw-r--r-- | src/sc_editor.c | 10 | ||||
-rw-r--r-- | src/sc_editor.h | 3 |
3 files changed, 13 insertions, 1 deletions
diff --git a/src/narrative_window.c b/src/narrative_window.c index 2d5727f..5976ada 100644 --- a/src/narrative_window.c +++ b/src/narrative_window.c @@ -272,6 +272,7 @@ NarrativeWindow *narrative_window_new(struct presentation *p, GApplication *app) sc_editor_set_logical_size(nw->sceditor, 640.0, 1024.0); sc_editor_set_background(nw->sceditor, 0.9, 0.9, 0.9); sc_editor_set_min_border(nw->sceditor, 40.0); + sc_editor_set_top_frame_editable(nw->sceditor, 1); g_signal_connect(G_OBJECT(nw->sceditor), "button-press-event", G_CALLBACK(button_press_sig), nw); diff --git a/src/sc_editor.c b/src/sc_editor.c index d8d93a1..d0b7b97 100644 --- a/src/sc_editor.c +++ b/src/sc_editor.c @@ -824,7 +824,8 @@ static gboolean button_press_sig(GtkWidget *da, GdkEventButton *event, } } else if ( (clicked == NULL) - || (clicked == sc_block_frame(e->scblocks)) ) + || ( !e->top_editable + && (clicked == sc_block_frame(e->scblocks)) ) ) { /* Clicked no object. Deselect old object and set up for * (maybe) creating a new one. */ @@ -1435,6 +1436,12 @@ void sc_editor_set_min_border(SCEditor *e, double min_border) } +void sc_editor_set_top_frame_editable(SCEditor *e, int top_frame_editable) +{ + e->top_editable = top_frame_editable; +} + + SCEditor *sc_editor_new(SCBlock *scblocks, SCBlock *stylesheet) { SCEditor *sceditor; @@ -1453,6 +1460,7 @@ SCEditor *sc_editor_new(SCBlock *scblocks, SCBlock *stylesheet) sceditor->stylesheet = stylesheet; sceditor->slidenum = 0; sceditor->min_border = 0.0; + sceditor->top_editable = 0; err = NULL; sceditor->bg_pixbuf = gdk_pixbuf_new_from_file(DATADIR"/colloquium/sky.png", &err); diff --git a/src/sc_editor.h b/src/sc_editor.h index ef05b56..eb6b90d 100644 --- a/src/sc_editor.h +++ b/src/sc_editor.h @@ -97,6 +97,7 @@ struct _sceditor /* Pointers to the frame currently being edited */ struct frame *selection; + int top_editable; PangoContext *pc; @@ -156,5 +157,7 @@ extern void sc_editor_redraw(SCEditor *e); extern void sc_editor_set_background(SCEditor *e, double r, double g, double b); extern void sc_editor_set_slidenum(SCEditor *e, int slidenum); extern void sc_editor_set_min_border(SCEditor *e, double min_border); +extern void sc_editor_set_top_frame_editable(SCEditor *e, + int top_frame_editable); #endif /* SC_EDITOR_H */ |