aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2013-12-06 23:13:26 +0100
committerThomas White <taw@bitwiz.org.uk>2013-12-06 23:13:26 +0100
commit1adc490d552edde21b8b7a42657bc053f7a842a5 (patch)
tree1a375be5a2fb491ea7b24a1689a3aecafd2a17e2 /src
parentd44a426026ec89488cd2a0c7a4b19b7b292d4ffd (diff)
More re-ordering fixes
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.c2
-rw-r--r--src/mainwindow.h1
-rw-r--r--src/slide_sorter.c18
3 files changed, 20 insertions, 1 deletions
diff --git a/src/mainwindow.c b/src/mainwindow.c
index fcd49a1..1b6c4b3 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -129,7 +129,7 @@ static void show_error(struct presentation *p, const char *message)
}
-static void update_toolbar(struct presentation *p)
+void update_toolbar(struct presentation *p)
{
GtkWidget *d;
int cur_slide_number;
diff --git a/src/mainwindow.h b/src/mainwindow.h
index ae8209a..b406492 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -34,6 +34,7 @@ extern int open_mainwindow(struct presentation *p);
extern void change_edit_slide(struct presentation *p, struct slide *np);
extern void redraw_editor(struct presentation *p);
extern void update_titlebar(struct presentation *p);
+extern void update_toolbar(struct presentation *p);
#endif /* MAINWINDOW_H */
diff --git a/src/slide_sorter.c b/src/slide_sorter.c
index e313016..3828e3b 100644
--- a/src/slide_sorter.c
+++ b/src/slide_sorter.c
@@ -313,6 +313,18 @@ static gboolean dnd_drop(GtkWidget *widget, GdkDragContext *drag_context,
}
+/* Normally, we don't need to explicitly render proj because the editor always
+ * gets there first. When re-arranging slides, this might not happen */
+static void fixup_proj(struct presentation *p, struct slide *s)
+{
+ if ( s->rendered_proj != NULL ) return;
+
+ s->rendered_proj = render_slide(s, s->parent->proj_slide_width,
+ p->slide_width, p->slide_height,
+ p->is, ISZ_SLIDESHOW);
+}
+
+
static void dnd_receive(GtkWidget *widget, GdkDragContext *drag_context,
gint x, gint y, GtkSelectionData *seldata,
guint info, guint time, struct slide_sorter *n)
@@ -356,9 +368,14 @@ static void dnd_receive(GtkWidget *widget, GdkDragContext *drag_context,
if ( n->dragging_cur_edit_slide ) {
change_edit_slide(n->p, s);
+ } else {
+ /* Slide order has changed, so slide change
+ * buttons might need to be greyed out */
+ update_toolbar(n->p);
}
if ( n->dragging_cur_proj_slide ) {
+ fixup_proj(n->p, s);
change_proj_slide(n->p, s);
}
@@ -443,6 +460,7 @@ static void dnd_delete(GtkWidget *widget, GdkDragContext *drag_context,
}
change_edit_slide(n->p, n->p->slides[ct]);
+ update_toolbar(n->p);
}