aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-07-03 23:10:40 +0800
committerChristian Persch <chpe@src.gnome.org>2003-07-03 23:10:40 +0800
commitf5299b00454e4aba71fd4a6d6e1043fffc7b08cc (patch)
tree27ca49e01462ed2ea2f2fc804ab8675b794b7707 /src/bookmarks
parentcb4d1dac50b27f9efc03e6b02ab6ee2cba958248 (diff)
downloadgsoc2013-epiphany-f5299b00454e4aba71fd4a6d6e1043fffc7b08cc.tar
gsoc2013-epiphany-f5299b00454e4aba71fd4a6d6e1043fffc7b08cc.tar.gz
gsoc2013-epiphany-f5299b00454e4aba71fd4a6d6e1043fffc7b08cc.tar.bz2
gsoc2013-epiphany-f5299b00454e4aba71fd4a6d6e1043fffc7b08cc.tar.lz
gsoc2013-epiphany-f5299b00454e4aba71fd4a6d6e1043fffc7b08cc.tar.xz
gsoc2013-epiphany-f5299b00454e4aba71fd4a6d6e1043fffc7b08cc.tar.zst
gsoc2013-epiphany-f5299b00454e4aba71fd4a6d6e1043fffc7b08cc.zip
Ellipsise the bookmarks titles.
2003-07-03 Christian Persch <chpe@cvs.gnome.org> * src/bookmarks/ephy-topic-action.c: (build_bookmarks_menu): Ellipsise the bookmarks titles.
Diffstat (limited to 'src/bookmarks')
-rw-r--r--src/bookmarks/ephy-topic-action.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/bookmarks/ephy-topic-action.c b/src/bookmarks/ephy-topic-action.c
index 02a426a5c..344010989 100644
--- a/src/bookmarks/ephy-topic-action.c
+++ b/src/bookmarks/ephy-topic-action.c
@@ -29,6 +29,7 @@
#include "eggtoolitem.h"
#include "ephy-debug.h"
#include "ephy-gui.h"
+#include "ephy-string.h"
static void ephy_topic_action_init (EphyTopicAction *action);
static void ephy_topic_action_class_init (EphyTopicActionClass *class);
@@ -187,6 +188,8 @@ sort_bookmarks (gconstpointer a, gconstpointer b)
return retval;
}
+#define MAX_LENGTH 32
+
static GtkWidget *
build_bookmarks_menu (EphyTopicAction *action, EphyNode *node)
{
@@ -226,6 +229,7 @@ build_bookmarks_menu (EphyTopicAction *action, EphyNode *node)
EphyNode *kid;
const char *icon_location;
const char *title;
+ char *title_short;
kid = (EphyNode*)l->data;
@@ -234,9 +238,10 @@ build_bookmarks_menu (EphyTopicAction *action, EphyNode *node)
title = ephy_node_get_property_string
(kid, EPHY_NODE_BMK_PROP_TITLE);
if (title == NULL) continue;
- LOG ("Create menu for bookmark %s", title)
+ title_short = ephy_string_shorten (title, MAX_LENGTH);
+ LOG ("Create menu for bookmark %s", title_short)
- item = gtk_image_menu_item_new_with_label (title);
+ item = gtk_image_menu_item_new_with_label (title_short);
if (icon_location)
{
GdkPixbuf *icon;
@@ -258,6 +263,8 @@ build_bookmarks_menu (EphyTopicAction *action, EphyNode *node)
G_CALLBACK (menu_activate_cb), action);
gtk_widget_show (item);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+
+ g_free (title_short);
}
g_list_free (node_list);