From f5299b00454e4aba71fd4a6d6e1043fffc7b08cc Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Thu, 3 Jul 2003 15:10:40 +0000 Subject: Ellipsise the bookmarks titles. 2003-07-03 Christian Persch * src/bookmarks/ephy-topic-action.c: (build_bookmarks_menu): Ellipsise the bookmarks titles. --- src/bookmarks/ephy-topic-action.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') 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); -- cgit v1.2.3