[gnome-photos] view-embed: Implement the window_mode_changed callback
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] view-embed: Implement the window_mode_changed callback
- Date: Fri, 27 Apr 2012 20:18:33 +0000 (UTC)
commit b684cd9a6215676605bcce82673b62c571492e43
Author: Debarshi Ray <debarshir gnome org>
Date: Fri Apr 27 22:16:59 2012 +0200
view-embed: Implement the window_mode_changed callback
src/photos-view-embed.c | 43 +++++++++++++++++++++++++++++++++++++++----
1 files changed, 39 insertions(+), 4 deletions(-)
---
diff --git a/src/photos-view-embed.c b/src/photos-view-embed.c
index 6573326..b87c6f2 100644
--- a/src/photos-view-embed.c
+++ b/src/photos-view-embed.c
@@ -56,10 +56,13 @@ photos_view_embed_fullscreen_changed (PhotosModeController *mode_cntrlr, gboolea
static void
-photos_view_embed_window_mode_changed (PhotosModeController *mode_cntrlr,
- PhotosWindowMode mode,
- PhotosWindowMode old_mode,
- gpointer user_data)
+photos_view_embed_prepare_for_overview (PhotosViewEmbed *self)
+{
+}
+
+
+static void
+photos_view_embed_prepare_for_preview (PhotosViewEmbed *self)
{
}
@@ -83,6 +86,38 @@ photos_view_embed_selection_toolbar_notify_width (GObject *object, GParamSpec *p
static void
+photos_view_embed_window_mode_change_flash (PhotosViewEmbed *self)
+{
+ PhotosViewEmbedPrivate *priv = self->priv;
+ ClutterAnimation *animation;
+
+ clutter_actor_raise_top (priv->background);
+ clutter_actor_set_opacity (priv->background, 255);
+
+ animation = clutter_actor_animate (priv->background, CLUTTER_EASE_IN_QUAD, 200, "opacity", 0, NULL);
+ g_signal_connect_swapped (animation, "completed", G_CALLBACK (clutter_actor_lower_bottom), priv->background);
+}
+
+
+static void
+photos_view_embed_window_mode_changed (PhotosModeController *mode_cntrlr,
+ PhotosWindowMode mode,
+ PhotosWindowMode old_mode,
+ gpointer user_data)
+{
+ PhotosViewEmbed *self = PHOTOS_VIEW_EMBED (user_data);
+
+ if (mode == PHOTOS_WINDOW_MODE_OVERVIEW)
+ photos_view_embed_prepare_for_overview (self);
+ else
+ photos_view_embed_prepare_for_preview (self);
+
+ if (old_mode != PHOTOS_WINDOW_MODE_NONE)
+ photos_view_embed_window_mode_change_flash (self);
+}
+
+
+static void
photos_view_embed_dispose (GObject *object)
{
PhotosViewEmbed *self = PHOTOS_VIEW_EMBED (object);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]