[Xfce4-commits] r17223 - libxfcegui4/trunk/libxfcegui4

Brian J. Tarricone bjt23 at cornell.edu
Wed Aug 31 22:20:47 CEST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 8/31/2005 1:07 PM, Olivier Fourdan wrote:
> Author: olivier
> Date: 2005-08-31 20:07:17 +0000 (Wed, 31 Aug 2005)
> New Revision: 17223
> 
> Modified:
>    libxfcegui4/trunk/libxfcegui4/netk-tasklist.c
> Log:
> Ellipsize text with gtk+ 2.6 and later (required for gtk+ 2.8)
> 
> Modified: libxfcegui4/trunk/libxfcegui4/netk-tasklist.c
> ===================================================================
> --- libxfcegui4/trunk/libxfcegui4/netk-tasklist.c	2005-08-31 19:22:14 UTC (rev 17222)
> +++ libxfcegui4/trunk/libxfcegui4/netk-tasklist.c	2005-08-31 20:07:17 UTC (rev 17223)
> @@ -2237,6 +2237,10 @@
>  
>      if (task->tasklist->priv->show_label) {
>          task->label = gtk_label_new (text);
> +        gtk_misc_set_alignment (GTK_MISC (task->label), 0.0, 0.5);
> +#if defined (GTK_CHECK_VERSION) && GTK_CHECK_VERSION(2,6,0)
> +        gtk_label_set_ellipsize (GTK_LABEL (task->label), PANGO_ELLIPSIZE_END);
> +#endif
>          gtk_widget_show (task->label);
>          gtk_table_attach (GTK_TABLE (table), task->label, 1, 2, 0, 1, 
>                            GTK_EXPAND|GTK_FILL|GTK_SHRINK, GTK_EXPAND, 0, 0);

Just being nitpicky, but might I suggest a conditional #ifndef #define
for PANGO_ELLIPSIZE_END at the top of the file, and then use a runtime
version check and
g_object_set(G_OBJECT(task->label),
             "ellipsize", PANGO_ELLIPSIZE_END,
             NULL);
instead?  That way if someone upgrades gtk versions, say from 2.4 to
2.8, they get the bugfix without needing to recompile libgui.

	-brian

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)

iD8DBQFDFhEf6XyW6VEeAnsRApoJAKDKYp0VRCi5IyzlALODEWKBQzT6ngCfRmbv
8yLUQzLShqBB1sPPMw3AqIY=
=4SXj
-----END PGP SIGNATURE-----



More information about the Xfce4-dev mailing list