[epiphany/wip/theme: 1/2] Remove totem-glow-button



commit 4b50d40a1752665f1319790f01a2e7bdb87d32f2
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Wed Aug 27 11:21:57 2014 -0500

    Remove totem-glow-button
    
    We'll use the needs-attention style class instead
    
    https://bugzilla.gnome.org/show_bug.cgi?id=735533

 lib/widgets/Makefile.am            |    4 +-
 lib/widgets/ephy-download-widget.c |   31 +++++---
 lib/widgets/totem-glow-button.c    |  156 ------------------------------------
 lib/widgets/totem-glow-button.h    |   47 -----------
 4 files changed, 21 insertions(+), 217 deletions(-)
---
diff --git a/lib/widgets/Makefile.am b/lib/widgets/Makefile.am
index 8673688..873e979 100644
--- a/lib/widgets/Makefile.am
+++ b/lib/widgets/Makefile.am
@@ -84,9 +84,7 @@ libephywidgets_la_SOURCES = \
        ephy-zoom-action.h                      \
        ephy-zoom-action.c                      \
        nautilus-floating-bar.c                 \
-       nautilus-floating-bar.h                 \
-       totem-glow-button.c                     \
-       totem-glow-button.h
+       nautilus-floating-bar.h
 
 libephywidgets_la_CPPFLAGS = \
        -I$(top_builddir)/lib           \
diff --git a/lib/widgets/ephy-download-widget.c b/lib/widgets/ephy-download-widget.c
index 4069a8d..23ea82a 100644
--- a/lib/widgets/ephy-download-widget.c
+++ b/lib/widgets/ephy-download-widget.c
@@ -28,7 +28,6 @@
 #include "ephy-debug.h"
 #include "ephy-embed-shell.h"
 #include "ephy-download.h"
-#include "totem-glow-button.h"
 
 #include <glib/gi18n.h>
 #include <webkit2/webkit2.h>
@@ -285,13 +284,23 @@ update_popup_menu (EphyDownloadWidget *widget)
 }
 
 static void
+set_needs_attention (EphyDownloadWidget *widget,
+                     gboolean needs_attention)
+{
+  if (needs_attention)
+    gtk_style_context_add_class (gtk_widget_get_style_context (widget->priv->button), "needs-attention");
+  else
+    gtk_style_context_remove_class (gtk_widget_get_style_context (widget->priv->button), "needs-attention");
+}
+
+static void
 widget_finished_cb (WebKitDownload *download,
                     EphyDownloadWidget *widget)
 {
   widget->priv->finished = TRUE;
   update_popup_menu (widget);
   update_download_label_and_tooltip (widget, _("Finished"));
-  totem_glow_button_set_glow (TOTEM_GLOW_BUTTON (widget->priv->button), TRUE);
+  set_needs_attention (widget, TRUE);
 }
 
 static void
@@ -311,7 +320,7 @@ widget_failed_cb (WebKitDownload *download,
   gtk_widget_set_tooltip_text (GTK_WIDGET (widget), error_msg);
   g_free (error_msg);
 
-  totem_glow_button_set_glow (TOTEM_GLOW_BUTTON (widget->priv->button), TRUE);
+  set_needs_attention (widget, TRUE);
 }
 
 static void
@@ -396,12 +405,6 @@ widget_destination_changed_cb (WebKitDownload *download,
 }
 
 static void
-stop_glowing (EphyDownloadWidget *widget)
-{
-  totem_glow_button_set_glow (TOTEM_GLOW_BUTTON (widget->priv->button), FALSE);
-}
-
-static void
 disconnect_download (EphyDownloadWidget *widget)
 {
   WebKitDownload *download;
@@ -559,6 +562,12 @@ smallify_label (GtkLabel *label)
 }
 
 static void
+menu_button_clicked_cb (EphyDownloadWidget *widget)
+{
+  set_needs_attention (widget, FALSE);
+}
+
+static void
 create_widget (EphyDownloadWidget *widget)
 {
 
@@ -572,7 +581,7 @@ create_widget (EphyDownloadWidget *widget)
   grid = gtk_grid_new ();
   gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
 
-  button = totem_glow_button_new ();
+  button = gtk_button_new ();
   menu_button = gtk_menu_button_new ();
   gtk_menu_button_set_direction (GTK_MENU_BUTTON (menu_button), GTK_ARROW_UP);
 
@@ -608,7 +617,7 @@ create_widget (EphyDownloadWidget *widget)
   g_signal_connect (button, "clicked",
                     G_CALLBACK (download_clicked_cb), widget);
   g_signal_connect_swapped (menu_button, "clicked",
-                            G_CALLBACK (stop_glowing), widget);
+                            G_CALLBACK (menu_button_clicked_cb), widget);
 
   gtk_widget_show_all (button);
   gtk_widget_show_all (menu_button);


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