diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-10-27 06:14:05 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-10-27 06:14:05 +0800 |
commit | 86c2f402bbc078f538bccce5b2c52546fb7a185a (patch) | |
tree | 4f5fa4e8e53eced0790ba85c19a84ec3167a9b43 /src/bookmarks/ephy-bookmarks-menu.c | |
parent | d51326e6b1a458b57cfae445fda4ed4b97b715a6 (diff) | |
download | gsoc2013-epiphany-86c2f402bbc078f538bccce5b2c52546fb7a185a.tar gsoc2013-epiphany-86c2f402bbc078f538bccce5b2c52546fb7a185a.tar.gz gsoc2013-epiphany-86c2f402bbc078f538bccce5b2c52546fb7a185a.tar.bz2 gsoc2013-epiphany-86c2f402bbc078f538bccce5b2c52546fb7a185a.tar.lz gsoc2013-epiphany-86c2f402bbc078f538bccce5b2c52546fb7a185a.tar.xz gsoc2013-epiphany-86c2f402bbc078f538bccce5b2c52546fb7a185a.tar.zst gsoc2013-epiphany-86c2f402bbc078f538bccce5b2c52546fb7a185a.zip |
Use ellipsising labels to shorten the bookmarks and topics titles in
2004-10-27 Christian Persch <chpe@cvs.gnome.org>
* src/bookmarks/ephy-bookmark-action.c: (create_tool_item),
(ephy_bookmark_action_sync_label), (connect_proxy),
(bookmark_changed_cb):
* src/bookmarks/ephy-bookmarks-menu.c: (connect_proxy_cb),
(ensure_bookmark_actions), (ephy_bookmarks_menu_rebuild):
* src/bookmarks/ephy-favorites-menu.c: (connect_proxy_cb),
(ephy_favorites_menu_rebuild):
* src/bookmarks/ephy-topic-action.c:
(ephy_topic_action_sync_label), (append_bookmarks_menu),
(build_topics_menu), (connect_proxy), (topic_changed_cb):
Use ellipsising labels to shorten the bookmarks and topics titles in
menus, instead of chopping the strings off at the end.
Fixes bug #147765.
Use gtk_entry_set_width_chars() to set the smart bookmark entry width,
not gtk_widget_set_size_request().
Diffstat (limited to 'src/bookmarks/ephy-bookmarks-menu.c')
-rw-r--r-- | src/bookmarks/ephy-bookmarks-menu.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/bookmarks/ephy-bookmarks-menu.c b/src/bookmarks/ephy-bookmarks-menu.c index 2ffcd994d..a681c97f0 100644 --- a/src/bookmarks/ephy-bookmarks-menu.c +++ b/src/bookmarks/ephy-bookmarks-menu.c @@ -71,6 +71,7 @@ struct _EphyBookmarksMenuPrivate #define GAZILLION 200 #define UPDATE_DELAY 5000 /* ms */ +#define LABEL_WIDTH_CHARS 32 enum { @@ -112,6 +113,21 @@ ephy_bookmarks_menu_get_type (void) } static void +connect_proxy_cb (GtkActionGroup *action_group, + GtkAction *action, + GtkWidget *proxy) +{ + if (GTK_IS_MENU_ITEM (proxy)) + { + GtkLabel *label; + + label = (GtkLabel *) ((GtkBin *) proxy)->child; + gtk_label_set_width_chars (label, LABEL_WIDTH_CHARS); + gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_END); + } +} + +static void remove_action (gpointer idptr, GtkActionGroup *action_group) { @@ -209,6 +225,9 @@ ensure_bookmark_actions (EphyBookmarksMenu *menu) gtk_ui_manager_insert_action_group (menu->priv->manager, menu->priv->bmk_actions, -1); + g_signal_connect (menu->priv->bmk_actions, "connect-proxy", + G_CALLBACK (connect_proxy_cb), NULL); + bookmarks = ephy_bookmarks_get_bookmarks (menu->priv->bookmarks); children = ephy_node_get_children (bookmarks); for (i = 0; i < children->len; i++) @@ -428,6 +447,9 @@ ephy_bookmarks_menu_rebuild (EphyBookmarksMenu *menu) p->folder_actions = gtk_action_group_new ("FolderActions"); gtk_ui_manager_insert_action_group (p->manager, p->folder_actions, -1); + g_signal_connect (p->folder_actions, "connect-proxy", + G_CALLBACK (connect_proxy_cb), NULL); + p->ui_id = gtk_ui_manager_new_merge_id (p->manager); topics = ephy_bookmarks_get_keywords (p->bookmarks); |