]> spindle.queued.net Git - midori/commitdiff
Search engines in completion should have a distinct background
authorChristian Dywan <christian@twotoasts.de>
Fri, 29 Jan 2010 22:49:10 +0000 (23:49 +0100)
committerChristian Dywan <christian@twotoasts.de>
Sat, 30 Jan 2010 00:52:22 +0000 (01:52 +0100)
midori/midori-locationaction.c

index 6cf9f0a9575c99b66cbe4f5d47a94eb5bbe7caa8..bc47d38aaf8d696060f9c9de6d15ceb8f26824a7 100644 (file)
@@ -86,6 +86,7 @@ enum
     VISITS_COL,
     VISIBLE_COL,
     YALIGN_COL,
+    BACKGROUND_COL,
     N_COLS
 };
 
@@ -267,7 +268,7 @@ midori_location_action_create_model (void)
 {
     GtkTreeModel* model = (GtkTreeModel*) gtk_list_store_new (N_COLS,
         GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING,
-        G_TYPE_INT, G_TYPE_BOOLEAN, G_TYPE_FLOAT);
+        G_TYPE_INT, G_TYPE_BOOLEAN, G_TYPE_FLOAT, GDK_TYPE_COLOR);
     return model;
 }
 
@@ -412,13 +413,18 @@ midori_location_action_popup_timeout_cb (gpointer data)
         renderer = gtk_cell_renderer_pixbuf_new ();
         gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (column), renderer, FALSE);
         gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (column), renderer,
-            "pixbuf", FAVICON_COL, "yalign", YALIGN_COL, NULL);
+            "pixbuf", FAVICON_COL, "yalign", YALIGN_COL,
+            "cell-background-gdk", BACKGROUND_COL,
+            NULL);
         renderer = gtk_cell_renderer_text_new ();
         g_object_set_data (G_OBJECT (renderer), "location-action", action);
         gtk_cell_renderer_set_fixed_size (renderer, 1, -1);
         gtk_cell_renderer_text_set_fixed_height_from_font (
             GTK_CELL_RENDERER_TEXT (renderer), 2);
         gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (column), renderer, TRUE);
+        gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (column), renderer,
+            "cell-background-gdk", BACKGROUND_COL,
+            NULL);
         gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (column), renderer,
                                             midori_location_entry_render_text_cb,
                                             action->entry, NULL);
@@ -455,11 +461,14 @@ midori_location_action_popup_timeout_cb (gpointer data)
         {
             gchar* uri;
             gchar* title;
+            GtkStyle* style;
 
             uri = sokoke_search_uri (katze_item_get_uri (item), action->key);
             title = g_strdup_printf (_("Search with %s"), katze_item_get_name (item));
+            style = gtk_widget_get_style (action->treeview);
             gtk_list_store_insert_with_values (store, NULL, matches,
                 URI_COL, uri, TITLE_COL, title, YALIGN_COL, 0.25,
+                BACKGROUND_COL, style ? &style->bg[GTK_STATE_NORMAL] : NULL,
                 FAVICON_COL, NULL, -1);
             g_free (uri);
             g_free (title);