[Xfce4-commits] <thunar:nick/gseal+clean> Use a GtkSpinner instead of the ThunarThrobber.

Nick Schermer noreply at xfce.org
Fri May 25 20:24:04 CEST 2012


Updating branch refs/heads/nick/gseal+clean
         to 75b5865b42ee6988a4012b1c89a75fba9766e04e (commit)
       from 268e8303540e9268e90e2c9532a4eea86bcfa673 (commit)

commit 75b5865b42ee6988a4012b1c89a75fba9766e04e
Author: Nick Schermer <nick at xfce.org>
Date:   Fri May 25 20:18:19 2012 +0200

    Use a GtkSpinner instead of the ThunarThrobber.
    
    This is a new widget since 2.20, so we can use it. In Gtk3
    this widget also has a special rendering class in the
    theme engine.

 .gitignore                          |    1 -
 po/POTFILES.in                      |    1 -
 thunar/Makefile.am                  |    9 -
 thunar/thunar-size-label.c          |   46 +++---
 thunar/thunar-throbber-fallback.h   |   31 ---
 thunar/thunar-throbber-fallback.png |  Bin 2713 -> 0 bytes
 thunar/thunar-throbber.c            |  371 -----------------------------------
 thunar/thunar-throbber.h            |   47 -----
 thunar/thunar-window.c              |   16 +-
 9 files changed, 31 insertions(+), 491 deletions(-)

diff --git a/.gitignore b/.gitignore
index 245172f..51fb0b1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -107,7 +107,6 @@ tests/data/.*.swp
 thunar/*.loT
 thunar/.*.swp
 thunar/thunar-fallback-icon.c
-thunar/thunar-throbber-fallback.c
 thunar/thunar-thumbnail-frame.c
 thunar/thunar-thumbnailer-manager-proxy.h
 thunar/thunar-thumbnailer-proxy.h
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 63e17af..751ba59 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -78,7 +78,6 @@ thunar/thunar-statusbar.c
 thunar/thunar-stock.c
 thunar/thunar-templates-action.c
 thunar/thunar-text-renderer.c
-thunar/thunar-throbber.c
 thunar/thunar-thumbnail-cache.c
 thunar/thunar-thumbnailer.c
 thunar/thunar-transfer-job.c
diff --git a/thunar/Makefile.am b/thunar/Makefile.am
index 0f9c198..4065d87 100644
--- a/thunar/Makefile.am
+++ b/thunar/Makefile.am
@@ -195,10 +195,6 @@ thunar_SOURCES =							\
 	thunar-templates-action.h					\
 	thunar-text-renderer.c						\
 	thunar-text-renderer.h						\
-	thunar-throbber.c						\
-	thunar-throbber.h						\
-	thunar-throbber-fallback.c					\
-	thunar-throbber-fallback.h					\
 	thunar-thumbnail-cache.c					\
 	thunar-thumbnail-cache.h					\
 	thunar-thumbnailer.c						\
@@ -318,7 +314,6 @@ DISTCLEANFILES +=							\
 	thunar-shortcuts-pane-ui.h					\
 	thunar-renamer-dialog-ui.h					\
 	thunar-standard-view-ui.h					\
-	thunar-throbber-fallback.c					\
 	thunar-thumbnail-frame.c					\
 	thunar-window-ui.h
 
@@ -331,7 +326,6 @@ BUILT_SOURCES =								\
 	thunar-shortcuts-pane-ui.h					\
 	thunar-renamer-dialog-ui.h					\
 	thunar-standard-view-ui.h					\
-	thunar-throbber-fallback.c					\
 	thunar-thumbnail-frame.c					\
 	thunar-window-ui.h
 
@@ -356,9 +350,6 @@ thunar-thumbnail-cache-proxy.h: $(srcdir)/thunar-thumbnail-cache-dbus.xml Makefi
 	)
 endif
 
-thunar-throbber-fallback.c: $(srcdir)/thunar-throbber-fallback.png Makefile
-	$(AM_V_GEN) (echo "#include <thunar/thunar-throbber-fallback.h>" && gdk-pixbuf-csource --extern --raw --stream --name=thunar_throbber_fallback $(srcdir)/thunar-throbber-fallback.png) > thunar-throbber-fallback.c
-
 thunar-thumbnail-frame.c: $(srcdir)/thunar-thumbnail-frame.png Makefile
 	$(AM_V_GEN) (echo "#include <thunar/thunar-thumbnail-frame.h>" && gdk-pixbuf-csource --extern --raw --stream --name=thunar_thumbnail_frame $(srcdir)/thunar-thumbnail-frame.png) > thunar-thumbnail-frame.c
 
diff --git a/thunar/thunar-size-label.c b/thunar/thunar-size-label.c
index c83758e..ad83e13 100644
--- a/thunar/thunar-size-label.c
+++ b/thunar/thunar-size-label.c
@@ -32,7 +32,6 @@
 #include <thunar/thunar-gtk-extensions.h>
 #include <thunar/thunar-private.h>
 #include <thunar/thunar-size-label.h>
-#include <thunar/thunar-throbber.h>
 #include <thunar/thunar-deep-count-job.h>
 
 
@@ -90,9 +89,9 @@ struct _ThunarSizeLabel
   ThunarFile         *file;
 
   GtkWidget          *label;
-  GtkWidget          *throbber;
+  GtkWidget          *spinner;
 
-  /* the throbber animation is started after a timeout */
+  /* the spinner animation is started after a timeout */
   gint                animate_timer_id;
 };
 
@@ -139,7 +138,7 @@ thunar_size_label_init (ThunarSizeLabel *size_label)
   /* configure the box */
   gtk_box_set_spacing (GTK_BOX (size_label), 6);
 
-  /* add an evenbox for the throbber */
+  /* add an evenbox for the spinner */
   ebox = gtk_event_box_new ();
   gtk_event_box_set_visible_window (GTK_EVENT_BOX (ebox), FALSE);
   g_signal_connect (G_OBJECT (ebox), "button-press-event", G_CALLBACK (thunar_size_label_button_press_event), size_label);
@@ -147,11 +146,12 @@ thunar_size_label_init (ThunarSizeLabel *size_label)
   gtk_box_pack_start (GTK_BOX (size_label), ebox, FALSE, FALSE, 0);
   gtk_widget_show (ebox);
 
-  /* add the throbber widget */
-  size_label->throbber = thunar_throbber_new ();
-  exo_binding_new (G_OBJECT (size_label->throbber), "visible", G_OBJECT (ebox), "visible");
-  gtk_container_add (GTK_CONTAINER (ebox), size_label->throbber);
-  gtk_widget_show (size_label->throbber);
+  /* add the spinner widget */
+  size_label->spinner = gtk_spinner_new ();
+  gtk_widget_set_size_request (size_label->spinner, 16, 16);
+  exo_binding_new (G_OBJECT (size_label->spinner), "visible", G_OBJECT (ebox), "visible");
+  gtk_container_add (GTK_CONTAINER (ebox), size_label->spinner);
+  gtk_widget_show (size_label->spinner);
 
   /* add the label widget */
   size_label->label = gtk_label_new ("");
@@ -243,7 +243,7 @@ thunar_size_label_button_press_event (GtkWidget       *ebox,
   _thunar_return_val_if_fail (GTK_IS_EVENT_BOX (ebox), FALSE);
   _thunar_return_val_if_fail (THUNAR_IS_SIZE_LABEL (size_label), FALSE);
 
-  /* left button press on the throbber cancels the calculation */
+  /* left button press on the spinner cancels the calculation */
   if (G_LIKELY (event->button == 1))
     {
       /* be sure to cancel the animate timer */
@@ -259,9 +259,9 @@ thunar_size_label_button_press_event (GtkWidget       *ebox,
           size_label->job = NULL;
         }
 
-      /* be sure to stop and hide the throbber */
-      thunar_throbber_set_animated (THUNAR_THROBBER (size_label->throbber), FALSE);
-      gtk_widget_hide (size_label->throbber);
+      /* be sure to stop and hide the spinner */
+      gtk_spinner_stop (GTK_SPINNER (size_label->spinner));
+      gtk_widget_hide (size_label->spinner);
 
       /* tell the user that the operation was canceled */
       gtk_label_set_text (GTK_LABEL (size_label->label), _("Calculation aborted"));
@@ -347,9 +347,9 @@ thunar_size_label_file_changed (ThunarFile      *file,
       size_label->job = NULL;
     }
 
-  /* be sure to stop and hide the throbber */
-  thunar_throbber_set_animated (THUNAR_THROBBER (size_label->throbber), FALSE);
-  gtk_widget_hide (size_label->throbber);
+  /* be sure to stop and hide the spinner */
+  gtk_spinner_stop (GTK_SPINNER (size_label->spinner));
+  gtk_widget_hide (size_label->spinner);
 
   /* check if the file is a directory */
   if (thunar_file_is_directory (file))
@@ -428,9 +428,9 @@ thunar_size_label_finished (ExoJob          *job,
   if (G_UNLIKELY (size_label->animate_timer_id >= 0))
     g_source_remove (size_label->animate_timer_id);
 
-  /* stop and hide the throbber */
-  thunar_throbber_set_animated (THUNAR_THROBBER (size_label->throbber), FALSE);
-  gtk_widget_hide (size_label->throbber);
+  /* stop and hide the spinner */
+  gtk_spinner_stop (GTK_SPINNER (size_label->spinner));
+  gtk_widget_hide (size_label->spinner);
 
   /* disconnect from the job */
   g_signal_handlers_disconnect_matched (size_label->job, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, size_label);
@@ -459,7 +459,7 @@ thunar_size_label_status_update (ThunarDeepCountJob *job,
   /* check if the animate timer is already running */
   if (G_UNLIKELY (size_label->animate_timer_id < 0))
     {
-      /* schedule the animate timer to animate and display the throbber after 1s */
+      /* schedule the animate timer to animate and display the spinner after 1s */
       size_label->animate_timer_id = g_timeout_add_full (G_PRIORITY_LOW, 1000, thunar_size_label_animate_timer,
                                                          size_label, thunar_size_label_animate_timer_destroy);
     }
@@ -488,9 +488,9 @@ thunar_size_label_animate_timer (gpointer user_data)
 
   GDK_THREADS_ENTER ();
 
-  /* animate and display the throbber */
-  thunar_throbber_set_animated (THUNAR_THROBBER (size_label->throbber), TRUE);
-  gtk_widget_show (size_label->throbber);
+  /* animate and display the spinner */
+  gtk_spinner_start (GTK_SPINNER (size_label->spinner));
+  gtk_widget_show (size_label->spinner);
 
   GDK_THREADS_LEAVE ();
 
diff --git a/thunar/thunar-throbber-fallback.h b/thunar/thunar-throbber-fallback.h
deleted file mode 100644
index 6481258..0000000
--- a/thunar/thunar-throbber-fallback.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2006 Benedikt Meurer <benny at xfce.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __THUNAR_THROBBER_FALLBACK_H__
-#define __THUNAR_THROBBER_FALLBACK_H__
-
-#include <glib.h>
-
-G_BEGIN_DECLS;
-
-extern const guint8 thunar_throbber_fallback[];
-
-G_END_DECLS;
-
-#endif /* !__THUNAR_THROBBER_FALLBACK_H__ */
diff --git a/thunar/thunar-throbber-fallback.png b/thunar/thunar-throbber-fallback.png
deleted file mode 100644
index 5f0a19d..0000000
Binary files a/thunar/thunar-throbber-fallback.png and /dev/null differ
diff --git a/thunar/thunar-throbber.c b/thunar/thunar-throbber.c
deleted file mode 100644
index 4bcd087..0000000
--- a/thunar/thunar-throbber.c
+++ /dev/null
@@ -1,371 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2005-2006 Benedikt Meurer <benny at xfce.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <exo/exo.h>
-
-#include <thunar/thunar-gobject-extensions.h>
-#include <thunar/thunar-private.h>
-#include <thunar/thunar-throbber.h>
-#include <thunar/thunar-throbber-fallback.h>
-
-
-
-/* Property identifiers */
-enum
-{
-  PROP_0,
-  PROP_ANIMATED,
-};
-
-
-
-static void     thunar_throbber_dispose       (GObject              *object);
-static void     thunar_throbber_get_property  (GObject              *object,
-                                               guint                 prop_id,
-                                               GValue               *value,
-                                               GParamSpec           *pspec);
-static void     thunar_throbber_set_property  (GObject              *object,
-                                               guint                 prop_id,
-                                               const GValue         *value,
-                                               GParamSpec           *pspec);
-static void     thunar_throbber_realize       (GtkWidget            *widget);
-static void     thunar_throbber_unrealize     (GtkWidget            *widget);
-static void     thunar_throbber_size_request  (GtkWidget            *widget,
-                                               GtkRequisition       *requisition);
-static gboolean thunar_throbber_expose_event  (GtkWidget            *widget,
-                                               GdkEventExpose       *event);
-static gboolean thunar_throbber_timer         (gpointer              user_data);
-static void     thunar_throbber_timer_destroy (gpointer              user_data);
-
-
-
-struct _ThunarThrobberClass
-{
-  GtkWidgetClass __parent__;
-};
-
-struct _ThunarThrobber
-{
-  GtkWidget __parent__;
-
-  GdkPixbuf *icon;
-
-  gboolean   animated;
-  gint       index;
-  gint       timer_id;
-};
-
-
-
-G_DEFINE_TYPE (ThunarThrobber, thunar_throbber, GTK_TYPE_WIDGET)
-
-
-
-static void
-thunar_throbber_class_init (ThunarThrobberClass *klass)
-{
-  GtkWidgetClass *gtkwidget_class;
-  GObjectClass   *gobject_class;
-  GdkPixbuf      *icon;
-
-  gobject_class = G_OBJECT_CLASS (klass);
-  gobject_class->dispose = thunar_throbber_dispose;
-  gobject_class->get_property = thunar_throbber_get_property;
-  gobject_class->set_property = thunar_throbber_set_property;
-
-  gtkwidget_class = GTK_WIDGET_CLASS (klass);
-  gtkwidget_class->realize = thunar_throbber_realize;
-  gtkwidget_class->unrealize = thunar_throbber_unrealize;
-  gtkwidget_class->size_request = thunar_throbber_size_request;
-  gtkwidget_class->expose_event = thunar_throbber_expose_event;
-
-  /**
-   * ThunarThrobber:animated:
-   *
-   * Whether the throbber should display an animation.
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_ANIMATED,
-                                   g_param_spec_boolean ("animated",
-                                                         "animated",
-                                                         "animated",
-                                                         FALSE,
-                                                         EXO_PARAM_READWRITE));
-
-  /* register the "process-working" fallback icon */
-  icon = gdk_pixbuf_new_from_inline (-1, thunar_throbber_fallback, FALSE, NULL);
-  gtk_icon_theme_add_builtin_icon ("process-working", 16, icon);
-  g_object_unref (G_OBJECT (icon));
-}
-
-
-
-static void
-thunar_throbber_init (ThunarThrobber *throbber)
-{
-  GTK_WIDGET_SET_FLAGS (throbber, GTK_NO_WINDOW);
-  throbber->timer_id = -1;
-}
-
-
-
-static void
-thunar_throbber_dispose (GObject *object)
-{
-  ThunarThrobber *throbber = THUNAR_THROBBER (object);
-
-  /* stop any running animation */
-  if (G_UNLIKELY (throbber->timer_id >= 0))
-    g_source_remove (throbber->timer_id);
-
-  (*G_OBJECT_CLASS (thunar_throbber_parent_class)->dispose) (object);
-}
-
-
-
-static void
-thunar_throbber_get_property (GObject    *object,
-                              guint       prop_id,
-                              GValue     *value,
-                              GParamSpec *pspec)
-{
-  ThunarThrobber *throbber = THUNAR_THROBBER (object);
-
-  switch (prop_id)
-    {
-    case PROP_ANIMATED:
-      g_value_set_boolean (value, thunar_throbber_get_animated (throbber));
-      break;
-
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-    }
-}
-
-
-
-static void
-thunar_throbber_set_property (GObject      *object,
-                              guint         prop_id,
-                              const GValue *value,
-                              GParamSpec   *pspec)
-{
-  ThunarThrobber *throbber = THUNAR_THROBBER (object);
-
-  switch (prop_id)
-    {
-    case PROP_ANIMATED:
-      thunar_throbber_set_animated (throbber, g_value_get_boolean (value));
-      break;
-
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-    }
-}
-
-
-
-static void
-thunar_throbber_realize (GtkWidget *widget)
-{
-  ThunarThrobber *throbber = THUNAR_THROBBER (widget);
-  GtkIconTheme   *icon_theme;
-
-  /* let Gtk+ realize the widget */
-  (*GTK_WIDGET_CLASS (thunar_throbber_parent_class)->realize) (widget);
-
-  /* determine the icon theme for our screen */
-  icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (widget));
-
-  /* try to lookup the "process-working" icon */
-  throbber->icon = gtk_icon_theme_load_icon (icon_theme, "process-working", 16, GTK_ICON_LOOKUP_USE_BUILTIN | GTK_ICON_LOOKUP_NO_SVG, NULL);
-}
-
-
-
-static void
-thunar_throbber_unrealize (GtkWidget *widget)
-{
-  ThunarThrobber *throbber = THUNAR_THROBBER (widget);
-
-  /* release the icon if any */
-  if (G_LIKELY (throbber->icon != NULL))
-    {
-      g_object_unref (G_OBJECT (throbber->icon));
-      throbber->icon = NULL;
-    }
-
-  /* let Gtk+ unrealize the widget */
-  (*GTK_WIDGET_CLASS (thunar_throbber_parent_class)->unrealize) (widget);
-}
-
-
-
-static void
-thunar_throbber_size_request (GtkWidget      *widget,
-                              GtkRequisition *requisition)
-{
-  requisition->width = 16;
-  requisition->height = 16;
-}
-
-
-
-static gboolean
-thunar_throbber_expose_event (GtkWidget      *widget,
-                              GdkEventExpose *event)
-{
-  ThunarThrobber *throbber = THUNAR_THROBBER (widget);
-  gint            icon_index;
-  gint            icon_cols;
-  gint            icon_rows;
-  gint            icon_x;
-  gint            icon_y;
-
-  /* verify that we have a valid icon */
-  if (G_LIKELY (throbber->icon != NULL))
-    {
-      /* determine the icon columns and icon rows */
-      icon_cols = gdk_pixbuf_get_width (throbber->icon) / 16;
-      icon_rows = gdk_pixbuf_get_height (throbber->icon) / 16;
-
-      /* verify that the icon is usable */
-      if (G_LIKELY (icon_cols > 0 && icon_rows > 0))
-        {
-          /* determine the icon index */
-          icon_index = throbber->index % (icon_cols * icon_rows);
-
-          /* make sure, we don't display the "empty state" while animated */
-          if (G_LIKELY (throbber->timer_id >= 0))
-            icon_index = MAX (icon_index, 1);
-
-          /* determine the icon x/y offset for the icon index */
-          icon_x = (icon_index % icon_cols) * 16;
-          icon_y = (icon_index / icon_cols) * 16;
-
-          /* render the given part of the icon */
-          gdk_draw_pixbuf (event->window, NULL, throbber->icon, icon_x, icon_y,
-                           widget->allocation.x, widget->allocation.y,
-                           16, 16, GDK_RGB_DITHER_NONE, 0, 0);
-        }
-    }
-
-  return TRUE;
-}
-
-
-
-static gboolean
-thunar_throbber_timer (gpointer user_data)
-{
-  ThunarThrobber *throbber = THUNAR_THROBBER (user_data);
-
-  GDK_THREADS_ENTER ();
-  throbber->index += 1;
-  gtk_widget_queue_draw (GTK_WIDGET (throbber));
-  GDK_THREADS_LEAVE ();
-
-  return throbber->animated;
-}
-
-
-
-static void
-thunar_throbber_timer_destroy (gpointer user_data)
-{
-  THUNAR_THROBBER (user_data)->index = 0;
-  THUNAR_THROBBER (user_data)->timer_id = -1;
-}
-
-
-
-/**
- * thunar_throbber_new:
- *
- * Allocates a new #ThunarThrobber instance.
- *
- * Return value: the newly allocated #ThunarThrobber.
- **/
-GtkWidget*
-thunar_throbber_new (void)
-{
-  return g_object_new (THUNAR_TYPE_THROBBER, NULL);
-}
-
-
-
-/**
- * thunar_throbber_get_animated:
- * @throbber : a #ThunarThrobber.
- *
- * Returns whether @throbber is currently animated.
- *
- * Return value: %TRUE if @throbber is animated.
- **/
-gboolean
-thunar_throbber_get_animated (const ThunarThrobber *throbber)
-{
-  _thunar_return_val_if_fail (THUNAR_IS_THROBBER (throbber), FALSE);
-  return throbber->animated;
-}
-
-
-
-/**
- * thunar_throbber_set_animated:
- * @throbber : a #ThunarThrobber.
- * @animated : whether to animate @throbber.
- *
- * If @animated is %TRUE, @throbber will display an animation.
- **/
-void
-thunar_throbber_set_animated (ThunarThrobber *throbber,
-                              gboolean        animated)
-{
-  _thunar_return_if_fail (THUNAR_IS_THROBBER (throbber));
-
-  /* check if we're already in the requested state */
-  if (G_UNLIKELY (throbber->animated == animated))
-    return;
-
-  /* pick up the new state */
-  throbber->animated = animated;
-
-  /* start the timer if animated and not already running */
-  if (animated && (throbber->timer_id < 0))
-    {
-      /* start the animation */
-      throbber->timer_id = g_timeout_add_full (G_PRIORITY_LOW, 25, thunar_throbber_timer,
-                                               throbber, thunar_throbber_timer_destroy);
-    }
-
-  /* schedule a redraw with the new animation state */
-  gtk_widget_queue_draw (GTK_WIDGET (throbber));
-
-  /* notify listeners */
-  g_object_notify (G_OBJECT (throbber), "animated");
-}
-
-
diff --git a/thunar/thunar-throbber.h b/thunar/thunar-throbber.h
deleted file mode 100644
index 9484f42..0000000
--- a/thunar/thunar-throbber.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2005-2006 Benedikt Meurer <benny at xfce.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __THUNAR_THROBBER_H__
-#define __THUNAR_THROBBER_H__
-
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS;
-
-typedef struct _ThunarThrobberClass ThunarThrobberClass;
-typedef struct _ThunarThrobber      ThunarThrobber;
-
-#define THUNAR_TYPE_THROBBER            (thunar_throbber_get_type ())
-#define THUNAR_THROBBER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), THUNAR_TYPE_THROBBER, ThunarThrobber))
-#define THUNAR_THROBBER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), THUNAR_TYPE_THROBBER, ThunarThrobberClass))
-#define THUNAR_IS_THROBBER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THUNAR_TYPE_THROBBER))
-#define THUNAR_IS_THROBBER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), THUNAR_TYPE_THROBBER))
-#define THUNAR_THROBBER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), THUNAR_TYPE_THROBBER, ThunarThrobberClass))
-
-GType      thunar_throbber_get_type     (void) G_GNUC_CONST;
-
-GtkWidget *thunar_throbber_new          (void) G_GNUC_MALLOC;
-
-gboolean   thunar_throbber_get_animated (const ThunarThrobber *throbber);
-void       thunar_throbber_set_animated (ThunarThrobber       *throbber,
-                                         gboolean              animated);
-
-G_END_DECLS;
-
-#endif /* !__THUNAR_THROBBER_H__ */
diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c
index 7e19e57..a669cb4 100644
--- a/thunar/thunar-window.c
+++ b/thunar/thunar-window.c
@@ -56,7 +56,6 @@
 #include <thunar/thunar-private.h>
 #include <thunar/thunar-statusbar.h>
 #include <thunar/thunar-stock.h>
-#include <thunar/thunar-throbber.h>
 #include <thunar/thunar-trash-action.h>
 #include <thunar/thunar-tree-pane.h>
 #include <thunar/thunar-window.h>
@@ -253,7 +252,7 @@ struct _ThunarWindow
   GClosure               *menu_item_deselected_closure;
 
   GtkWidget              *table;
-  GtkWidget              *throbber;
+  GtkWidget              *spinner;
   GtkWidget              *paned;
   GtkWidget              *sidepane;
   GtkWidget              *view_box;
@@ -785,17 +784,18 @@ thunar_window_init (ThunarWindow *window)
   gtk_table_attach (GTK_TABLE (window->table), menubar, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
   gtk_widget_show (menubar);
 
-  /* append the menu item for the throbber */
+  /* append the menu item for the spinner */
   item = gtk_menu_item_new ();
   gtk_widget_set_sensitive (GTK_WIDGET (item), FALSE);
   gtk_menu_item_set_right_justified (GTK_MENU_ITEM (item), TRUE);
   gtk_menu_shell_append (GTK_MENU_SHELL (menubar), item);
   gtk_widget_show (item);
 
-  /* place the throbber into the menu item */
-  window->throbber = thunar_throbber_new ();
-  gtk_container_add (GTK_CONTAINER (item), window->throbber);
-  gtk_widget_show (window->throbber);
+  /* place the spinner into the menu item */
+  window->spinner = gtk_spinner_new ();
+  gtk_container_add (GTK_CONTAINER (item), window->spinner);
+  gtk_widget_set_size_request (window->spinner, 16, 16);
+  gtk_widget_show (window->spinner);
 
   /* check if we need to add the root warning */
   if (G_UNLIKELY (geteuid () == 0))
@@ -1902,7 +1902,7 @@ thunar_window_action_view_changed (GtkRadioAction *action,
       g_signal_connect_swapped (G_OBJECT (window->view), "change-directory", G_CALLBACK (thunar_window_set_current_directory), window);
       exo_binding_new (G_OBJECT (window), "current-directory", G_OBJECT (window->view), "current-directory");
       exo_binding_new (G_OBJECT (window), "show-hidden", G_OBJECT (window->view), "show-hidden");
-      exo_binding_new (G_OBJECT (window->view), "loading", G_OBJECT (window->throbber), "animated");
+      exo_binding_new (G_OBJECT (window->view), "loading", G_OBJECT (window->spinner), "active");
       exo_binding_new (G_OBJECT (window->view), "selected-files", G_OBJECT (window->launcher), "selected-files");
       exo_mutual_binding_new (G_OBJECT (window->view), "zoom-level", G_OBJECT (window), "zoom-level");
       gtk_table_attach (GTK_TABLE (window->view_box), window->view, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);


More information about the Xfce4-commits mailing list