aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-bookmark-action.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-07-17 23:47:22 +0800
committerChristian Persch <chpe@src.gnome.org>2005-07-17 23:47:22 +0800
commit11a6200a0dbd2dcd22281e8c0138d3eb753fe9a5 (patch)
tree580af2e2edd99eef490bacc428a8971636129bc6 /src/bookmarks/ephy-bookmark-action.c
parent36e9eb39a6d68cd8b1b75ef22d79bedd7a3a5586 (diff)
downloadgsoc2013-epiphany-11a6200a0dbd2dcd22281e8c0138d3eb753fe9a5.tar
gsoc2013-epiphany-11a6200a0dbd2dcd22281e8c0138d3eb753fe9a5.tar.gz
gsoc2013-epiphany-11a6200a0dbd2dcd22281e8c0138d3eb753fe9a5.tar.bz2
gsoc2013-epiphany-11a6200a0dbd2dcd22281e8c0138d3eb753fe9a5.tar.lz
gsoc2013-epiphany-11a6200a0dbd2dcd22281e8c0138d3eb753fe9a5.tar.xz
gsoc2013-epiphany-11a6200a0dbd2dcd22281e8c0138d3eb753fe9a5.tar.zst
gsoc2013-epiphany-11a6200a0dbd2dcd22281e8c0138d3eb753fe9a5.zip
Fix smart bookmark options parsing. Now encoding= really works, and added
2005-07-17 Christian Persch <chpe@cvs.gnome.org> * src/bookmarks/ephy-bookmark-action.c: (ephy_bookmark_action_sync_smart_url): * src/bookmarks/ephy-bookmarks.c: (resolve_cb), (browse_cb), (ephy_bookmarks_init), (update_has_smart_address), (get_option), (ephy_bookmarks_solve_smart_url), (ephy_bookmarks_get_smart_bookmark_width): * src/bookmarks/ephy-bookmarks.h: Fix smart bookmark options parsing. Now encoding= really works, and added width= for bug #116709. Also fixes bug #132761.
Diffstat (limited to 'src/bookmarks/ephy-bookmark-action.c')
-rw-r--r--src/bookmarks/ephy-bookmark-action.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c
index 61d4865bb..e1964a8a7 100644
--- a/src/bookmarks/ephy-bookmark-action.c
+++ b/src/bookmarks/ephy-bookmark-action.c
@@ -53,8 +53,8 @@
#include <string.h>
/* FIXME tweak this, or make it configurable? (bug 148093) */
-#define ENTRY_WIDTH_CHARS 16
-#define TOOLITEM_WIDTH_CHARS 24
+#define ENTRY_WIDTH_CHARS 12
+#define TOOLITEM_WIDTH_CHARS 20
static void ephy_bookmark_action_init (EphyBookmarkAction *action);
static void ephy_bookmark_action_class_init (EphyBookmarkActionClass *class);
@@ -163,27 +163,25 @@ create_tool_item (GtkAction *action)
}
static void
-ephy_bookmark_action_sync_smart_url (GtkAction *action, GParamSpec *pspec, GtkWidget *proxy)
+ephy_bookmark_action_sync_smart_url (GtkAction *gaction, GParamSpec *pspec, GtkWidget *proxy)
{
if (GTK_IS_TOOL_ITEM (proxy))
{
+ EphyBookmarkAction *action = EPHY_BOOKMARK_ACTION (gaction);
+ EphyBookmarkActionPrivate *priv = action->priv;
+ gboolean is_smart_url = priv->smart_url;
GtkWidget *entry, *icon;
- gboolean smart_url;
+ guint width;
+
+ width = is_smart_url ? ephy_bookmarks_get_smart_bookmark_width (priv->node) : 0;
- smart_url = EPHY_BOOKMARK_ACTION (action)->priv->smart_url;
entry = GTK_WIDGET (g_object_get_data (G_OBJECT (proxy), "entry"));
icon = GTK_WIDGET (g_object_get_data (G_OBJECT (proxy), "icon"));
- if (smart_url)
- {
- gtk_widget_hide (icon);
- gtk_widget_show (entry);
- }
- else
- {
- gtk_widget_show (icon);
- gtk_widget_hide (entry);
- }
+ g_object_set (icon, "visible", !is_smart_url, NULL);
+ g_object_set (entry, "visible", is_smart_url, NULL);
+ gtk_entry_set_width_chars (GTK_ENTRY (entry),
+ width > 0 ? width : ENTRY_WIDTH_CHARS);
}
}