diff options
author | Bastien Nocera <hadess@hadess.net> | 2022-02-09 13:34:40 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2022-02-09 14:24:49 +0100 |
commit | e702f39b6955fc08b230cb0ee60433e3b0d12817 (patch) | |
tree | 2b04d7401d84e2b389d1d06ce347e75ab09e06ca | |
parent | 6a035610f1221ea2d39d8d976dfccf9ed8ad61dd (diff) | |
download | totem-e702f39b6955fc08b230cb0ee60433e3b0d12817.tar.gz |
main: Move video widget creation to GtkBuilder
-rw-r--r-- | data/totem.ui | 8 | ||||
-rw-r--r-- | src/totem-object.c | 8 |
2 files changed, 9 insertions, 7 deletions
diff --git a/data/totem.ui b/data/totem.ui index e70da8863..891ecb659 100644 --- a/data/totem.ui +++ b/data/totem.ui @@ -186,6 +186,14 @@ <object class="GtkStack" id="tmw_main_stack"> <property name="visible">True</property> <property name="homogeneous">True</property> + <child> + <object class="BaconVideoWidget" id="bvw"> + <property name="visible">True</property> + </object> + <packing> + <property name="name">player</property> + </packing> + </child> </object> </child> </object> diff --git a/src/totem-object.c b/src/totem-object.c index c73bd521a..fa505e5cb 100644 --- a/src/totem-object.c +++ b/src/totem-object.c @@ -180,6 +180,7 @@ totem_object_app_activate (GApplication *app) if (totem->xml == NULL) totem_object_exit (NULL); + totem->bvw = BACON_VIDEO_WIDGET (gtk_builder_get_object (totem->xml, "bvw")); totem->win = GTK_WIDGET (gtk_builder_get_object (totem->xml, "totem_main_window")); #if DEVELOPMENT_VERSION style_context = gtk_widget_get_style_context (GTK_WIDGET (totem->win)); @@ -4232,8 +4233,6 @@ video_widget_create (TotemObject *totem) { GError *err = NULL; - totem->bvw = BACON_VIDEO_WIDGET (bacon_video_widget_new ()); - if (!bacon_video_widget_check_init (totem->bvw, &err)) { totem_object_show_error_and_exit (_("Totem could not startup."), err != NULL ? err->message : _("No reason."), totem); if (err != NULL) @@ -4289,10 +4288,6 @@ video_widget_create (TotemObject *totem) G_CALLBACK (on_bvw_motion_notify_cb), totem); - gtk_stack_add_named (GTK_STACK (totem->stack), - GTK_WIDGET (totem->bvw), - "player"); - totem->bvw_grid = gtk_grid_new (); gtk_overlay_add_overlay (GTK_OVERLAY (totem->bvw), totem->bvw_grid); gtk_widget_set_halign (totem->bvw_grid, GTK_ALIGN_FILL); @@ -4314,7 +4309,6 @@ video_widget_create (TotemObject *totem) target_table, G_N_ELEMENTS (target_table), GDK_ACTION_MOVE); - gtk_widget_show (GTK_WIDGET (totem->bvw)); gtk_widget_realize (GTK_WIDGET (totem->bvw)); } |