aboutsummaryrefslogtreecommitdiff
path: root/libstorycode/gtk/gtkslideview.c
diff options
context:
space:
mode:
Diffstat (limited to 'libstorycode/gtk/gtkslideview.c')
-rw-r--r--libstorycode/gtk/gtkslideview.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libstorycode/gtk/gtkslideview.c b/libstorycode/gtk/gtkslideview.c
index 0990a6f..c0c0d9e 100644
--- a/libstorycode/gtk/gtkslideview.c
+++ b/libstorycode/gtk/gtkslideview.c
@@ -1021,6 +1021,11 @@ static void do_backspace(GtkSlideView *e, signed int dir)
struct slide_pos p1, p2;
size_t o1, o2;
+ if ( e->cursor_frame->type == SLIDE_ITEM_IMAGE ) {
+ gtk_slide_view_delete_selected_frame(e);
+ return;
+ }
+
if ( !slide_positions_equal(e->sel_start, e->sel_end) ) {
/* Block delete */
@@ -1118,6 +1123,8 @@ static gboolean key_press_sig(GtkWidget *da, GdkEventKey *event,
event);
if ( r ) return FALSE; /* IM ate it */
+ if ( e->cursor_frame == NULL ) return FALSE;
+
switch ( event->keyval ) {
case GDK_KEY_Left :
@@ -1166,6 +1173,17 @@ static gboolean key_press_sig(GtkWidget *da, GdkEventKey *event,
}
+void gtk_slide_view_delete_selected_frame(GtkSlideView *e)
+{
+ if ( e->cursor_frame == NULL ) return;
+ slide_delete_item(e->slide, e->cursor_frame);
+ unset_selection(e);
+ e->cursor_frame = NULL;
+ emit_change_sig(e);
+ redraw(e);
+}
+
+
static gboolean dnd_motion(GtkWidget *widget, GdkDragContext *drag_context,
gint x, gint y, guint time, GtkSlideView *e)
{