[ease/themes] [editor] Redraw slide thumbnails when slides change
- From: Nate Stedman <natesm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ease/themes] [editor] Redraw slide thumbnails when slides change
- Date: Thu, 22 Jul 2010 22:20:45 +0000 (UTC)
commit fe182d3fc751c4bcaf276c95a55bda8289be78bc
Author: Nate Stedman <natesm gmail com>
Date: Thu Jul 22 18:19:24 2010 -0400
[editor] Redraw slide thumbnails when slides change
src/ease-editor-embed.vala | 4 ++++
src/ease-editor-window.vala | 8 ++++++--
src/ease-slide-button-panel.vala | 25 +++++++++++++++++++++++++
src/ease-slide.vala | 5 +++++
src/ease-text-actor.vala | 1 +
5 files changed, 41 insertions(+), 2 deletions(-)
---
diff --git a/src/ease-editor-embed.vala b/src/ease-editor-embed.vala
index 30ac67f..eeaae76 100644
--- a/src/ease-editor-embed.vala
+++ b/src/ease-editor-embed.vala
@@ -519,6 +519,8 @@ public class Ease.EditorEmbed : ScrollableEmbed
mouse_y = event.y;
position_selection();
+
+ selected.element.parent.changed(selected.element.parent);
}
return true;
}
@@ -626,6 +628,8 @@ public class Ease.EditorEmbed : ScrollableEmbed
position_selection();
+ selected.element.parent.changed(selected.element.parent);
+
return true;
}
diff --git a/src/ease-editor-window.vala b/src/ease-editor-window.vala
index b4f8b60..f73f200 100644
--- a/src/ease-editor-window.vala
+++ b/src/ease-editor-window.vala
@@ -273,6 +273,7 @@ public class Ease.EditorWindow : Gtk.Window
update_undo();
embed.slide_actor.relayout();
embed.reposition_group();
+ slide.changed(slide);
}
[CCode (instance_pos = -1)]
@@ -282,6 +283,7 @@ public class Ease.EditorWindow : Gtk.Window
update_undo();
embed.slide_actor.relayout();
embed.reposition_group();
+ slide.changed(slide);
}
[CCode (instance_pos = -1)]
@@ -483,6 +485,7 @@ public class Ease.EditorWindow : Gtk.Window
{
embed.set_element_color(Transformations.gdk_color_to_clutter_color(
sender.current_color));
+ slide.changed(slide);
}
private void color_dialog_selection(Object sender, ParamSpec spec)
@@ -497,8 +500,9 @@ public class Ease.EditorWindow : Gtk.Window
private ZoomSlider create_zoom_slider()
{
// create zoom slider
- zoom_slider = new AnimatedZoomSlider(new Gtk.Adjustment(100, 10, 400, 10,
- 50, 50), ZOOM_LEVELS);
+ zoom_slider = new AnimatedZoomSlider(new Gtk.Adjustment(100, 10, 400,
+ 10, 50, 50),
+ ZOOM_LEVELS);
zoom_slider.width_request = 200;
zoom_slider.value_pos = Gtk.PositionType.RIGHT;
zoom_slider.digits = 0;
diff --git a/src/ease-slide-button-panel.vala b/src/ease-slide-button-panel.vala
index 4802a68..09db3ac 100644
--- a/src/ease-slide-button-panel.vala
+++ b/src/ease-slide-button-panel.vala
@@ -82,6 +82,7 @@ public class Ease.SlideButtonPanel : Gtk.ScrolledWindow
string path = "";
var pb = pixbuf(slide, PREV_WIDTH, out path);
list_store.set(iter, 0, pb, 1, slide, 2, path);
+ slide.changed.connect(slide_redraw);
}
// create the tree view
@@ -115,12 +116,14 @@ public class Ease.SlideButtonPanel : Gtk.ScrolledWindow
string path = "";
var pb = pixbuf(slide, PREV_WIDTH, out path);
list_store.set(itr, 0, pb, 1, slide, 2, path);
+ slide.changed.connect(slide_redraw);
});
// handle the removal of slides
document.slide_deleted.connect((slide, index) => {
Gtk.TreeIter itr;
Slide s = new Slide();
+ slide.changed.connect(slide_redraw);
if (!list_store.get_iter_first(out itr)) return;
do
{
@@ -170,6 +173,28 @@ public class Ease.SlideButtonPanel : Gtk.ScrolledWindow
}
/**
+ * Redraws a { link Slide} when it is changed.
+ *
+ * @param slide The slide to redraw.
+ */
+ private void slide_redraw(Slide slide)
+ {
+ Gtk.TreeIter itr;
+ Slide s = new Slide();
+ string path = "";
+ if (!list_store.get_iter_first(out itr)) return;
+ do
+ {
+ list_store.get(itr, 1, ref s, 2, ref path);
+ if (s == slide)
+ {
+ var pb = pixbuf(slide, PREV_WIDTH, out path);
+ list_store.set(itr, 0, pb, 2, path);
+ }
+ } while (list_store.iter_next(ref itr));
+ }
+
+ /**
* Creates a Gdk.Pixbuf for a given slide.
*
* @param slide The slide to create a pixbuf of.
diff --git a/src/ease-slide.vala b/src/ease-slide.vala
index 34939d5..a383e1d 100644
--- a/src/ease-slide.vala
+++ b/src/ease-slide.vala
@@ -142,6 +142,11 @@ public class Ease.Slide : GLib.Object
}
/**
+ * Emitted when an { link Element} or property of this Slide is changed.
+ */
+ public signal void changed(Slide self);
+
+ /**
* Create a new Slide.
*/
public Slide() {}
diff --git a/src/ease-text-actor.vala b/src/ease-text-actor.vala
index ebc740f..9cc2ab4 100644
--- a/src/ease-text-actor.vala
+++ b/src/ease-text-actor.vala
@@ -133,6 +133,7 @@ public class Ease.TextActor : Actor
private void text_changed(Clutter.Text sender)
{
element.set("text", sender.text);
+ element.parent.changed(element.parent);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]