[epiphany] Add secondary icon to EphySuggestion



commit 42e35ede2495d77e5c577ff7a80a8a5e70923f28
Author: Jan-Michael Brummer <jan brummer tabos org>
Date:   Thu Dec 26 11:00:15 2019 +0100

    Add secondary icon to EphySuggestion
    
    Add secondary icons for bookmarks: Fixes https://gitlab.gnome.org/GNOME/epiphany/issues/895
    
    Add secondary icon for jump-to-tab: Fixes: https://gitlab.gnome.org/GNOME/epiphany/issues/861

 lib/ephy-suggestion.c       | 8 +++++++-
 lib/ephy-suggestion.h       | 2 ++
 meson.build                 | 2 +-
 src/ephy-suggestion-model.c | 6 +++++-
 4 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/lib/ephy-suggestion.c b/lib/ephy-suggestion.c
index fc4c04ed2..7ab80dcf7 100644
--- a/lib/ephy-suggestion.c
+++ b/lib/ephy-suggestion.c
@@ -98,7 +98,6 @@ ephy_suggestion_get_icon_surface (DzlSuggestion *self,
   return suggestion->favicon;
 }
 
-
 static void
 ephy_suggestion_class_init (EphySuggestionClass *klass)
 {
@@ -213,3 +212,10 @@ ephy_suggestion_set_favicon (EphySuggestion  *self,
   self->favicon = favicon;
   g_object_notify (G_OBJECT (self), "icon");
 }
+
+void
+ephy_suggestion_set_secondary_icon (EphySuggestion *self,
+                                    const char     *icon_name)
+{
+  dzl_suggestion_set_secondary_icon_name (DZL_SUGGESTION (self), icon_name);
+}
diff --git a/lib/ephy-suggestion.h b/lib/ephy-suggestion.h
index 85bf8a28b..bfd270c7c 100644
--- a/lib/ephy-suggestion.h
+++ b/lib/ephy-suggestion.h
@@ -42,5 +42,7 @@ const char     *ephy_suggestion_get_uri                  (EphySuggestion *self);
 
 void            ephy_suggestion_set_favicon              (EphySuggestion  *self,
                                                           cairo_surface_t *favicon);
+void            ephy_suggestion_set_secondary_icon       (EphySuggestion  *self,
+                                                          const char      *icon_name);
 
 G_END_DECLS
diff --git a/meson.build b/meson.build
index cee9ba7d1..d1abfd248 100644
--- a/meson.build
+++ b/meson.build
@@ -91,7 +91,7 @@ gtk_unix_print_dep = dependency('gtk+-unix-print-3.0', version: gtk_requirement)
 hogweed_dep = dependency('hogweed', version: nettle_requirement)
 iso_codes_dep = dependency('iso-codes', version: '>= 0.35')
 json_glib_dep = dependency('json-glib-1.0', version: '>= 1.2.4')
-libdazzle_dep = dependency('libdazzle-1.0', version: '>= 3.31.90')
+libdazzle_dep = dependency('libdazzle-1.0', version: '>= 3.35.3')
 libhandy_dep = dependency('libhandy-0.0', version: '>= 0.0.10')
 libnotify_dep = dependency('libnotify', version: '>= 0.5.1')
 libsecret_dep = dependency('libsecret-1', version: '>= 0.19.0')
diff --git a/src/ephy-suggestion-model.c b/src/ephy-suggestion-model.c
index 9be813471..9e5fdfc58 100644
--- a/src/ephy-suggestion-model.c
+++ b/src/ephy-suggestion-model.c
@@ -284,6 +284,7 @@ add_bookmarks (EphySuggestionModel *self,
       markup = dzl_fuzzy_highlight (escaped_title, query, FALSE);
       suggestion = ephy_suggestion_new (markup, title, url);
       load_favicon (self, suggestion, url);
+      ephy_suggestion_set_secondary_icon (suggestion, "starred-symbolic");
 
       new_urls = g_list_prepend (new_urls, g_strdup (url));
       g_sequence_append (self->items, suggestion);
@@ -429,10 +430,13 @@ add_tabs (EphySuggestionModel *self,
     title_casefold = g_utf8_casefold (title, -1);
 
     if ((title_casefold && strstr (title_casefold, query_casefold)) || strstr (display_address_casefold, 
query_casefold)) {
+      char *escaped_address = g_markup_escape_text (display_address, -1);
+
       escaped_title = g_markup_escape_text (title, -1);
       markup = dzl_fuzzy_highlight (escaped_title, query, FALSE);
-      suggestion = ephy_suggestion_new_with_custom_subtitle (markup, title, _("Switch to Tab"), address);
+      suggestion = ephy_suggestion_new_with_custom_subtitle (markup, title, escaped_address, address);
       load_favicon (self, suggestion, display_address);
+      ephy_suggestion_set_secondary_icon (suggestion, "go-jump-symbolic");
 
       g_sequence_append (self->urls, g_strdup (url));
       g_sequence_append (self->items, suggestion);


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