[totem] main: Switch to player page when starting a video
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] main: Switch to player page when starting a video
- Date: Wed, 8 May 2013 10:36:52 +0000 (UTC)
commit a814301d877a05cfdc7b94f7a8c378ee09d1bd59
Author: Bastien Nocera <hadess hadess net>
Date: Mon May 6 18:02:41 2013 +0200
main: Switch to player page when starting a video
src/totem-object.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/src/totem-object.c b/src/totem-object.c
index 43aedfe..e7b1a87 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -573,6 +573,23 @@ totem_object_get_current_time (TotemObject *totem)
return bacon_video_widget_get_current_time (totem->bvw);
}
+static void
+switch_to_page (Totem *totem,
+ const char *page)
+{
+ GtkStackTransitionType type;
+
+ if (g_str_equal (page, "player"))
+ type = GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT;
+ else
+ type = GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT;
+
+ /* FIXME should we increase the minimum duration like that? */
+ gtk_stack_set_transition_duration (GTK_STACK (totem->stack), 500);
+ gtk_stack_set_transition_type (GTK_STACK (totem->stack), type);
+ gtk_stack_set_visible_child_name (GTK_STACK (totem->stack), page);
+}
+
typedef struct {
TotemObject *totem;
gchar *uri;
@@ -597,6 +614,7 @@ add_to_playlist_and_play_cb (TotemPlaylist *playlist, GAsyncResult *async_result
subtitle = NULL;
totem_playlist_set_current (playlist, end);
mrl = totem_playlist_get_current_mrl (playlist, &subtitle);
+ switch_to_page (data->totem, "player");
totem_action_set_mrl_and_play (data->totem, mrl, subtitle);
g_free (mrl);
g_free (subtitle);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]