[epiphany] overview: removed hard-wired thumbnail frame



commit 91eebf7c0ff872287ef5ffaf702e6e50809e9e88
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Wed Feb 19 17:24:15 2014 +0200

    overview: removed hard-wired thumbnail frame

 data/Makefile.am                        |    3 +-
 data/thumbnail-frame.png                |  Bin 1238 -> 0 bytes
 embed/ephy-about-handler.c              |    2 +-
 embed/ephy-embed-shell.c                |    4 --
 embed/web-extension/ephy-web-overview.c |    6 +-
 lib/widgets/ephy-overview-store.c       |   81 ++----------------------------
 lib/widgets/ephy-overview-store.h       |    3 -
 7 files changed, 11 insertions(+), 88 deletions(-)
---
diff --git a/data/Makefile.am b/data/Makefile.am
index 1e9c324..1f67d31 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -53,8 +53,7 @@ $(default_bookmarks_DATA): $(default_bookmarks_in_files) Makefile $(INTLTOOL_MER
 
 iconsdir = $(pkgdatadir)/icons
 dist_icons_DATA =         \
-    missing-thumbnail.png \
-    thumbnail-frame.png
+    missing-thumbnail.png
 
 searchproviderdir = $(datadir)/gnome-shell/search-providers
 dist_searchprovider_DATA = epiphany-search-provider.ini
diff --git a/embed/ephy-about-handler.c b/embed/ephy-about-handler.c
index 439e3ff..35812bf 100644
--- a/embed/ephy-about-handler.c
+++ b/embed/ephy-about-handler.c
@@ -449,7 +449,7 @@ ephy_about_handler_generate_overview_html (EphyOverviewStore *store)
       EPHY_OVERVIEW_STORE_SNAPSHOT_PATH, &row_snapshot,
       -1);
 
-    thumbnail_style = row_snapshot ? g_strdup_printf (" style=\"background: 
url(ephy-about:/thumbnail-frame.png), url(file://%s) no-repeat 10px 9px;\"", row_snapshot) : NULL;
+    thumbnail_style = row_snapshot ? g_strdup_printf (" style=\"background: url(file://%s) no-repeat;\"", 
row_snapshot) : NULL;
     g_free (row_snapshot);
 
     g_string_append_printf (data_str,
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index 0efa3c7..0efa012 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -395,23 +395,19 @@ EphyFrecentStore *
 ephy_embed_shell_get_frecent_store (EphyEmbedShell *shell)
 {
   GdkPixbuf *default_icon;
-  GdkPixbuf *frame;
 
   g_return_val_if_fail (EPHY_IS_EMBED_SHELL (shell), NULL);
 
   if (shell->priv->frecent_store == NULL) {
     shell->priv->frecent_store = ephy_frecent_store_new ();
     default_icon = ephy_embed_shell_get_overview_icon ("missing-thumbnail.png");
-    frame = ephy_embed_shell_get_overview_icon ("thumbnail-frame.png");
     g_object_set (shell->priv->frecent_store,
                   "history-service",
                   ephy_embed_shell_get_global_history_service (shell),
                   "history-length", 10,
                   "default-icon", default_icon,
-                  "icon-frame", frame,
                   NULL);
     g_object_unref (default_icon);
-    g_object_unref (frame);
   }
 
   return shell->priv->frecent_store;
diff --git a/embed/web-extension/ephy-web-overview.c b/embed/web-extension/ephy-web-overview.c
index c51f437..0687353 100644
--- a/embed/web-extension/ephy-web-overview.c
+++ b/embed/web-extension/ephy-web-overview.c
@@ -155,7 +155,7 @@ ephy_web_overview_model_urls_changed (EphyWebOverviewModel *model,
       if (thumbnail_path) {
         char *style;
 
-        style = g_strdup_printf ("background: url(ephy-about:/thumbnail-frame.png), url(file://%s) no-repeat 
10px 9px;", thumbnail_path);
+        style = g_strdup_printf ("background: url(file://%s) no-repeat;", thumbnail_path);
         webkit_dom_element_set_attribute (item->thumbnail, "style", style, NULL);
         g_free (style);
       } else {
@@ -195,7 +195,7 @@ ephy_web_overview_model_urls_changed (EphyWebOverviewModel *model,
       if (thumbnail_path) {
         char *style;
 
-        style = g_strdup_printf ("background: url(ephy-about:/thumbnail-frame.png), url(file://%s) no-repeat 
10px 9px;", thumbnail_path);
+        style = g_strdup_printf ("background: url(file://%s) no-repeat;", thumbnail_path);
         webkit_dom_element_set_attribute (WEBKIT_DOM_ELEMENT (new_node), "style", style, NULL);
         g_free (style);
       }
@@ -244,7 +244,7 @@ ephy_web_overview_model_thumbnail_changed (EphyWebOverviewModel *model,
     if (g_strcmp0 (item->url, url) != 0)
       continue;
 
-    style = g_strdup_printf ("background: url(ephy-about:/thumbnail-frame.png), url(file://%s) no-repeat 
10px 9px;", path);
+    style = g_strdup_printf ("background: url(file://%s) no-repeat;", path);
     webkit_dom_element_set_attribute (item->thumbnail, "style", style, NULL);
     g_free (style);
   }
diff --git a/lib/widgets/ephy-overview-store.c b/lib/widgets/ephy-overview-store.c
index 34f88bf..7719326 100644
--- a/lib/widgets/ephy-overview-store.c
+++ b/lib/widgets/ephy-overview-store.c
@@ -33,15 +33,13 @@ struct _EphyOverviewStorePrivate
 {
   EphyHistoryService *history_service;
   GdkPixbuf *default_icon;
-  GdkPixbuf *icon_frame;
 };
 
 enum
 {
   PROP_0,
   PROP_HISTORY_SERVICE,
-  PROP_DEFAULT_ICON,
-  PROP_ICON_FRAME,
+  PROP_DEFAULT_ICON
 };
 
 enum {
@@ -72,10 +70,6 @@ ephy_overview_store_set_property (GObject *object,
     ephy_overview_store_set_default_icon (store,
                                           g_value_get_object (value));
     break;
-  case PROP_ICON_FRAME:
-    ephy_overview_store_set_icon_frame (store,
-                                        g_value_get_object (value));
-    break;
   default:
     G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
     break;
@@ -98,9 +92,6 @@ ephy_overview_store_get_property (GObject *object,
   case PROP_DEFAULT_ICON:
     g_value_set_object (value, store->priv->default_icon);
     break;
-  case PROP_ICON_FRAME:
-    g_value_set_object (value, store->priv->icon_frame);
-    break;
   default:
     G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
     break;
@@ -116,8 +107,6 @@ ephy_overview_store_dispose (GObject *object)
     g_clear_object (&priv->history_service);
   if (priv->default_icon)
     g_clear_object (&priv->default_icon);
-  if (priv->icon_frame)
-    g_clear_object (&priv->icon_frame);
 
   G_OBJECT_CLASS (ephy_overview_store_parent_class)->dispose (object);
 }
@@ -147,14 +136,6 @@ ephy_overview_store_class_init (EphyOverviewStoreClass *klass)
                                                         GDK_TYPE_PIXBUF,
                                                         G_PARAM_READWRITE | G_PARAM_STATIC_NAME | 
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
 
-  g_object_class_install_property (object_class,
-                                   PROP_ICON_FRAME,
-                                   g_param_spec_object ("icon-frame",
-                                                        "Icon frame",
-                                                        "Frame to display around icons",
-                                                        GDK_TYPE_PIXBUF,
-                                                        G_PARAM_READWRITE | G_PARAM_STATIC_NAME | 
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
-
   signals[SNAPSHOT_SAVED] =
     g_signal_new ("snapshot-saved",
                   EPHY_TYPE_OVERVIEW_STORE,
@@ -211,24 +192,6 @@ peek_context_free (PeekContext *ctx)
   g_slice_free (PeekContext, ctx);
 }
 
-static GdkPixbuf *
-ephy_overview_store_add_frame (EphyOverviewStore *store,
-                               GdkPixbuf *snapshot)
-{
-  GdkPixbuf *framed;
-
-  if (store->priv->icon_frame) {
-    framed = gdk_pixbuf_copy (store->priv->icon_frame);
-    gdk_pixbuf_copy_area (snapshot, 0, 0,
-                          gdk_pixbuf_get_width (snapshot),
-                          gdk_pixbuf_get_height (snapshot),
-                          framed, 10, 9);
-  } else
-    framed = g_object_ref (snapshot);
-
-  return framed;
-}
-
 static void
 ephy_overview_store_set_snapshot_internal (EphyOverviewStore *store,
                                            GtkTreeIter *iter,
@@ -236,15 +199,11 @@ ephy_overview_store_set_snapshot_internal (EphyOverviewStore *store,
                                            char *path,
                                            int mtime)
 {
-  GdkPixbuf *framed;
-
-  framed = ephy_overview_store_add_frame (store, snapshot);
   gtk_list_store_set (GTK_LIST_STORE (store), iter,
-                      EPHY_OVERVIEW_STORE_SNAPSHOT, framed,
+                      EPHY_OVERVIEW_STORE_SNAPSHOT, snapshot,
                       EPHY_OVERVIEW_STORE_SNAPSHOT_MTIME, mtime,
                       EPHY_OVERVIEW_STORE_SNAPSHOT_PATH, path,
                       -1);
-  g_object_unref (framed);
 
   if (path) {
     char *url;
@@ -508,49 +467,21 @@ void
 ephy_overview_store_set_default_icon (EphyOverviewStore *store,
                                       GdkPixbuf *default_icon)
 {
-  GdkPixbuf *new_default_icon;
+  g_return_if_fail (EPHY_IS_OVERVIEW_STORE (store));
+  g_return_if_fail (GDK_IS_PIXBUF (default_icon));
 
   if (store->priv->default_icon)
     g_object_unref (store->priv->default_icon);
 
-  new_default_icon = ephy_overview_store_add_frame (store, default_icon);
-
   gtk_tree_model_foreach (GTK_TREE_MODEL (store),
                           (GtkTreeModelForeachFunc) set_default_icon_helper,
-                          new_default_icon);
+                          default_icon);
 
-  store->priv->default_icon = new_default_icon;
+  store->priv->default_icon = g_object_ref (default_icon);
 
   g_object_notify (G_OBJECT (store), "default-icon");
 }
 
-void
-ephy_overview_store_set_icon_frame (EphyOverviewStore *store,
-                                    GdkPixbuf *icon_frame)
-{
-  gboolean update_default = FALSE;
-  GdkPixbuf *old_default_icon;
-
-  if (store->priv->icon_frame == icon_frame)
-    return;
-
-  if (store->priv->icon_frame)
-    g_object_unref (store->priv->icon_frame);
-  else if (store->priv->default_icon)
-    update_default = TRUE;
-
-  store->priv->icon_frame = g_object_ref (icon_frame);
-
-  if (update_default) {
-    old_default_icon = g_object_ref (store->priv->default_icon);
-    ephy_overview_store_set_default_icon (store,
-                                          old_default_icon);
-    g_object_unref (old_default_icon);
-  }
-
-  g_object_notify (G_OBJECT (store), "icon-frame");
-}
-
 gboolean
 ephy_overview_store_needs_snapshot (EphyOverviewStore *store,
                                     GtkTreeIter *iter)
diff --git a/lib/widgets/ephy-overview-store.h b/lib/widgets/ephy-overview-store.h
index fb74cb5..aa2c300 100644
--- a/lib/widgets/ephy-overview-store.h
+++ b/lib/widgets/ephy-overview-store.h
@@ -72,9 +72,6 @@ void     ephy_overview_store_peek_snapshot        (EphyOverviewStore *self,
 void     ephy_overview_store_set_default_icon     (EphyOverviewStore *store,
                                                    GdkPixbuf         *default_icon);
 
-void     ephy_overview_store_set_icon_frame       (EphyOverviewStore *store,
-                                                   GdkPixbuf *icon_frame);
-
 gboolean ephy_overview_store_needs_snapshot       (EphyOverviewStore *store,
                                                    GtkTreeIter       *iter);
 


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