# HG changeset patch # User Federico Mena Quintero # Date 1264708620 0 # Node ID 9c3e0f2e82ea21f2b9e022e6e72c37b84ba5967f # Parent 48d2b6d1ab7470c46a57c2ee35f5b6f3609c0a35 Show tooltip for ellipsized tab titles. (Some bits changed from the original patch for GTK+ version compatibility) committer: Sadrul Habib Chowdhury diff -r 48d2b6d1ab74 -r 9c3e0f2e82ea pidgin/gtkconv.c --- a/pidgin/gtkconv.c Thu Jan 28 17:44:28 2010 +0000 +++ b/pidgin/gtkconv.c Thu Jan 28 19:57:00 2010 +0000 @@ -9508,6 +9508,24 @@ return FALSE; } +static gboolean +gtkconv_tab_set_tip(GtkWidget *widget, GdkEventCrossing *event, PidginConversation *gtkconv) +{ +#if GTK_CHECK_VERSION(2, 12, 0) +#define gtk_tooltips_set_tip(tips, w, l, p) gtk_widget_set_tooltip_text(w, l) +#endif + PangoLayout *layout; + + layout = gtk_label_get_layout(GTK_LABEL(gtkconv->tab_label)); + gtk_tooltips_set_tip(gtkconv->tooltips, widget, + pango_layout_is_ellipsized(layout) ? gtk_label_get_text(GTK_LABEL(gtkconv->tab_label)) : NULL, + NULL); + return FALSE; +#if GTK_CHECK_VERSION(2, 12, 0) +#undef gtk_tooltips_set_tip +#endif +} + void pidgin_conv_window_add_gtkconv(PidginWindow *win, PidginConversation *gtkconv) { @@ -9666,6 +9684,8 @@ gtk_event_box_set_visible_window(GTK_EVENT_BOX(ebox), FALSE); #endif gtk_container_add(GTK_CONTAINER(ebox), gtkconv->tabby); + g_signal_connect(G_OBJECT(ebox), "enter-notify-event", + G_CALLBACK(gtkconv_tab_set_tip), gtkconv); if (gtkconv->tab_label->parent == NULL) { /* Pack if it's a new widget */