[Xfce4-commits] <midori:master> Show description or URI below search suggestions

Christian Dywan noreply at xfce.org
Mon Feb 20 22:00:03 CET 2012


Updating branch refs/heads/master
         to f3a4bd4b6a8cf5d2559bd898f29e697cfc197349 (commit)
       from a064a5f120e2157ff07b6303992de934432ee34c (commit)

commit f3a4bd4b6a8cf5d2559bd898f29e697cfc197349
Author: Christian Dywan <christian at twotoasts.de>
Date:   Mon Feb 20 21:56:06 2012 +0100

    Show description or URI below search suggestions
    
    In fact, laying out the completion popup is problematic
    if we have rows of different heights.

 midori/midori-locationaction.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c
index 60a08e2..93061b9 100644
--- a/midori/midori-locationaction.c
+++ b/midori/midori-locationaction.c
@@ -562,9 +562,11 @@ midori_location_action_popup_timeout_cb (gpointer data)
         else if (type == 2 /* search_view */)
         {
             gchar* search_title = g_strdup_printf (_("Search for %s"), title);
+            gchar* search_desc = g_strdup_printf ("%s\n%s", search_title, uri);
             gtk_list_store_insert_with_values (store, NULL, matches,
-                URI_COL, uri, TITLE_COL, search_title, YALIGN_COL, 0.25,
+                URI_COL, uri, TITLE_COL, search_desc, YALIGN_COL, 0.25,
                 STYLE_COL, 1, FAVICON_COL, icon, -1);
+            g_free (search_desc);
             g_free (search_title);
         }
         if (icon != NULL)
@@ -588,17 +590,22 @@ midori_location_action_popup_timeout_cb (gpointer data)
         {
             gchar* uri;
             gchar* title;
+            const gchar* text;
+            gchar* desc;
             GdkPixbuf* icon;
 
             uri = midori_uri_for_search (katze_item_get_uri (item), action->key);
             title = g_strdup_printf (_("Search with %s"), katze_item_get_name (item));
+            text = katze_item_get_text (item);
+            desc = g_strdup_printf ("%s\n%s", title, text ? text : uri);
             icon = midori_search_action_get_icon (item, action->treeview, NULL, FALSE);
             gtk_list_store_insert_with_values (store, NULL, matches + i,
-                URI_COL, uri, TITLE_COL, title, YALIGN_COL, 0.25,
+                URI_COL, uri, TITLE_COL, desc, YALIGN_COL, 0.25,
                 BACKGROUND_COL, style ? &style->bg[GTK_STATE_NORMAL] : NULL,
                 STYLE_COL, 1, FAVICON_COL, icon, -1);
             g_free (uri);
             g_free (title);
+            g_free (desc);
             if (icon != NULL)
                 g_object_unref (icon);
             i++;


More information about the Xfce4-commits mailing list