aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2006-12-18 03:08:40 +0800
committerChristian Persch <chpe@src.gnome.org>2006-12-18 03:08:40 +0800
commit7bb2d46bde7f24278f1eef01fc97854b870b948f (patch)
treeefb093f4ebe169001fff8b7090523bebe7102772
parentbbe2b5bf9901099d93388ffdac41afce0a6f96e2 (diff)
downloadgsoc2013-epiphany-7bb2d46bde7f24278f1eef01fc97854b870b948f.tar
gsoc2013-epiphany-7bb2d46bde7f24278f1eef01fc97854b870b948f.tar.gz
gsoc2013-epiphany-7bb2d46bde7f24278f1eef01fc97854b870b948f.tar.bz2
gsoc2013-epiphany-7bb2d46bde7f24278f1eef01fc97854b870b948f.tar.lz
gsoc2013-epiphany-7bb2d46bde7f24278f1eef01fc97854b870b948f.tar.xz
gsoc2013-epiphany-7bb2d46bde7f24278f1eef01fc97854b870b948f.tar.zst
gsoc2013-epiphany-7bb2d46bde7f24278f1eef01fc97854b870b948f.zip
List title and URL in location entry drop-down. Bug #169550, patch by
2006-12-17 Christian Persch <chpe@cvs.gnome.org> * lib/widgets/ephy-location-entry.c: (ephy_location_entry_set_completion): * lib/widgets/ephy-location-entry.h: * src/ephy-completion-model.c: (ephy_completion_model_get_column_type), (ephy_completion_model_get_value): * src/ephy-completion-model.h: * src/ephy-location-action.c: (connect_proxy): List title and URL in location entry drop-down. Bug #169550, patch by Diego Escalante Urrelo.
-rw-r--r--ChangeLog14
-rw-r--r--lib/widgets/ephy-location-entry.c25
-rw-r--r--lib/widgets/ephy-location-entry.h3
-rw-r--r--src/ephy-completion-model.c12
-rw-r--r--src/ephy-completion-model.h1
-rw-r--r--src/ephy-location-action.c3
6 files changed, 54 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index bfcf0abe8..79393387b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,20 @@
2006-12-17 Christian Persch <chpe@cvs.gnome.org>
* lib/widgets/ephy-location-entry.c:
+ (ephy_location_entry_set_completion):
+ * lib/widgets/ephy-location-entry.h:
+ * src/ephy-completion-model.c:
+ (ephy_completion_model_get_column_type),
+ (ephy_completion_model_get_value):
+ * src/ephy-completion-model.h:
+ * src/ephy-location-action.c: (connect_proxy):
+
+ List title and URL in location entry drop-down. Bug #169550,
+ patch by Diego Escalante Urrelo.
+
+2006-12-17 Christian Persch <chpe@cvs.gnome.org>
+
+ * lib/widgets/ephy-location-entry.c:
(ephy_location_entry_style_set):
Fix secure location bar colouring with dark themes. Bug #347343,
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c
index 1a5247927..77f5d7514 100644
--- a/lib/widgets/ephy-location-entry.c
+++ b/lib/widgets/ephy-location-entry.c
@@ -75,6 +75,7 @@ struct _EphyLocationEntryPrivate
guint action_col;
guint keywords_col;
guint relevance_col;
+ guint extra_col;
guint hash;
@@ -997,17 +998,19 @@ ephy_location_entry_set_completion (EphyLocationEntry *le,
guint text_col,
guint action_col,
guint keywords_col,
- guint relevance_col)
+ guint relevance_col,
+ guint extra_col)
{
EphyLocationEntryPrivate *priv = le->priv;
GtkTreeModel *sort_model;
GtkEntryCompletion *completion;
- GtkCellRenderer *cell;
+ GtkCellRenderer *cell, *extracell;
le->priv->text_col = text_col;
le->priv->action_col = action_col;
le->priv->keywords_col = keywords_col;
le->priv->relevance_col = relevance_col;
+ le->priv->extra_col = extra_col;
sort_model = gtk_tree_model_sort_new_with_model (model);
g_object_unref (model);
@@ -1025,11 +1028,29 @@ ephy_location_entry_set_completion (EphyLocationEntry *le,
G_CALLBACK (action_activated_after_cb), le);
cell = gtk_cell_renderer_text_new ();
+ g_object_set (cell,
+ "ellipsize", PANGO_ELLIPSIZE_END,
+ "ellipsize-set", TRUE,
+ NULL);
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (completion),
cell, TRUE);
gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (completion),
cell, "text", text_col);
+ extracell = gtk_cell_renderer_text_new ();
+ g_object_set (extracell,
+ "ellipsize", PANGO_ELLIPSIZE_END,
+ "ellipsize-set", TRUE,
+ "foreground", "Gray",
+ "foreground-set", TRUE,
+ "alignment", PANGO_ALIGN_RIGHT,
+ NULL);
+
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (completion),
+ extracell, TRUE);
+ gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (completion),
+ extracell, "text", extra_col);
+
gtk_entry_set_completion (GTK_ENTRY (priv->icon_entry->entry), completion);
g_object_unref (completion);
}
diff --git a/lib/widgets/ephy-location-entry.h b/lib/widgets/ephy-location-entry.h
index f1fba28ce..cdd02130f 100644
--- a/lib/widgets/ephy-location-entry.h
+++ b/lib/widgets/ephy-location-entry.h
@@ -71,7 +71,8 @@ void ephy_location_entry_set_completion (EphyLocationEntry *le,
guint text_col,
guint action_col,
guint keywords_col,
- guint relevance_col);
+ guint relevance_col,
+ guint extra_col);
void ephy_location_entry_set_location (EphyLocationEntry *le,
const char *address,
diff --git a/src/ephy-completion-model.c b/src/ephy-completion-model.c
index b54122bf8..75358c096 100644
--- a/src/ephy-completion-model.c
+++ b/src/ephy-completion-model.c
@@ -271,6 +271,7 @@ ephy_completion_model_get_column_type (GtkTreeModel *tree_model,
case EPHY_COMPLETION_TEXT_COL:
case EPHY_COMPLETION_ACTION_COL:
case EPHY_COMPLETION_KEYWORDS_COL:
+ case EPHY_COMPLETION_EXTRA_COL:
type = G_TYPE_STRING;
break;
case EPHY_COMPLETION_RELEVANCE_COL:
@@ -427,6 +428,17 @@ ephy_completion_model_get_value (GtkTreeModel *tree_model,
switch (column)
{
+ case EPHY_COMPLETION_EXTRA_COL:
+ g_value_init (value, G_TYPE_STRING);
+ /* We set an additional text for the item title only for history, since we assume that people know the url of their bookmarks */
+ if (group == HISTORY_GROUP)
+ {
+ const char *text;
+ text = ephy_node_get_property_string
+ (node, EPHY_NODE_PAGE_PROP_TITLE);
+ g_value_set_string (value, text);
+ }
+ break;
case EPHY_COMPLETION_TEXT_COL:
g_value_init (value, G_TYPE_STRING);
init_text_col (value, node, group);
diff --git a/src/ephy-completion-model.h b/src/ephy-completion-model.h
index 319c94eed..d54470912 100644
--- a/src/ephy-completion-model.h
+++ b/src/ephy-completion-model.h
@@ -40,6 +40,7 @@ typedef enum
EPHY_COMPLETION_ACTION_COL,
EPHY_COMPLETION_KEYWORDS_COL,
EPHY_COMPLETION_RELEVANCE_COL,
+ EPHY_COMPLETION_EXTRA_COL,
N_COL
} EphyCompletionColumn;
diff --git a/src/ephy-location-action.c b/src/ephy-location-action.c
index df230479c..25af807a5 100644
--- a/src/ephy-location-action.c
+++ b/src/ephy-location-action.c
@@ -368,7 +368,8 @@ connect_proxy (GtkAction *action, GtkWidget *proxy)
EPHY_COMPLETION_TEXT_COL,
EPHY_COMPLETION_ACTION_COL,
EPHY_COMPLETION_KEYWORDS_COL,
- EPHY_COMPLETION_RELEVANCE_COL);
+ EPHY_COMPLETION_RELEVANCE_COL,
+ EPHY_COMPLETION_EXTRA_COL);
add_completion_actions (action, proxy);