[totem/wip/hadess/glsink: 87/89] SPINNER
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem/wip/hadess/glsink: 87/89] SPINNER
- Date: Thu, 14 Oct 2021 08:58:05 +0000 (UTC)
commit 0c45bab71e43cfbd3f609b67afa56d24585be7d7
Author: Bastien Nocera <hadess hadess net>
Date: Tue Oct 12 09:57:38 2021 +0200
SPINNER
src/totem-object.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
---
diff --git a/src/totem-object.c b/src/totem-object.c
index 865a802f7..538301c12 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -217,9 +217,12 @@ 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_label_new ("<span size='xx-large'>100%</span>");
+ //FIXME SPINNER should replace the play button, controls popup when needed
+ totem->spinner = gtk_spinner_new ();
+ //totem->spinner = gtk_label_new ("<span size='xx-large'>100%</span>");
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);
totem->seek = GTK_WIDGET (gtk_builder_get_object (totem->controls, "seek_scale"));
totem->seekadj = gtk_range_get_adjustment (GTK_RANGE (totem->seek));
@@ -2492,17 +2495,29 @@ static void
on_buffering_event (BaconVideoWidget *bvw, gdouble percent, TotemObject *totem)
{
if (percent >= 1.0) {
+ gtk_spinner_stop (GTK_SPINNER (totem->spinner));
gtk_widget_hide (totem->spinner);
- gtk_label_set_markup (GTK_LABEL (totem->spinner), "");
+ //gtk_label_set_markup (GTK_LABEL (totem->spinner), "");
} else {
g_autofree char *text = NULL;
text = g_strdup_printf ("<span size='xx-large'>%.2f%%</span>", percent * 100);
- gtk_label_set_markup (GTK_LABEL (totem->spinner), text);
+ //gtk_label_set_markup (GTK_LABEL (totem->spinner), text);
gtk_widget_show (totem->spinner);
+ gtk_spinner_start (GTK_SPINNER (totem->spinner));
}
}
+static gboolean
+fill_up (gpointer user_data)
+{
+ static gfloat percent = 0.0;
+ TotemObject *totem = user_data;
+ on_buffering_event (totem->bvw, percent, totem);
+ percent += 0.01;
+ return G_SOURCE_CONTINUE;
+}
+
static void
on_download_buffering_event (BaconVideoWidget *bvw, gdouble level, TotemObject *totem)
{
@@ -4185,6 +4200,8 @@ video_widget_create (TotemObject *totem)
gtk_widget_show (totem->bvw_grid);
add_fullscreen_toolbar (totem, totem->bvw_grid);
+ g_timeout_add (250, fill_up, totem);
+
/* Events for the widget video window as well */
gtk_widget_add_events (GTK_WIDGET (totem->bvw),
GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]