[totem/wip/hadess/bvw-template: 5/6] main: Move spinner to GtkBuilder




commit 6cc4e6f9299e2121d2c2b76b35b242a7eb431852
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Feb 9 14:24:22 2022 +0100

    main: Move spinner to GtkBuilder

 data/totem.ui      | 16 ++++++++++++++++
 src/totem-object.c |  7 +------
 2 files changed, 17 insertions(+), 6 deletions(-)
---
diff --git a/data/totem.ui b/data/totem.ui
index 415fff3d7..a8921e5fb 100644
--- a/data/totem.ui
+++ b/data/totem.ui
@@ -194,6 +194,22 @@
                 <property name="visible">True</property>
                 <property name="halign">fill</property>
                 <property name="valign">fill</property>
+                <child>
+                  <object class="GtkSpinner" id="spinner">
+                    <property name="visible">False</property>
+                    <property name="vexpand">True</property>
+                    <property name="hexpand">True</property>
+                    <style>
+                      <class name="osd"/>
+                    </style>
+                  </object>
+                  <packing>
+                    <property name="left-attach">1</property>
+                    <property name="top-attach">2</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
               </object>
             </child>
           </object>
diff --git a/src/totem-object.c b/src/totem-object.c
index f780db92a..50ba1738d 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -227,12 +227,7 @@ totem_object_app_activate (GApplication *app)
        gtk_widget_set_vexpand (GTK_WIDGET (gtk_builder_get_object (totem->controls, "toolbar")), TRUE);
        gtk_widget_set_valign (GTK_WIDGET (gtk_builder_get_object (totem->controls, "toolbar")), 
GTK_ALIGN_END);
 
-       totem->spinner = gtk_spinner_new ();
-       gtk_grid_attach (GTK_GRID (totem->bvw_grid), totem->spinner, 1, 2, 1, 1);
-       gtk_widget_set_vexpand (totem->spinner, TRUE);
-       gtk_widget_set_hexpand (totem->spinner, TRUE);
-       style_context = gtk_widget_get_style_context (totem->spinner);
-       gtk_style_context_add_class (style_context, "osd");
+       totem->spinner = GTK_WIDGET (gtk_builder_get_object (totem->xml, "spinner"));
 
        totem->seek = GTK_WIDGET (gtk_builder_get_object (totem->controls, "seek_scale"));
        totem->seekadj = gtk_range_get_adjustment (GTK_RANGE (totem->seek));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]