Re: [PATCH][RFC] Improve icon view line breaks



On Sun, 2005-12-11 at 22:11 +0100, Christian Neumair wrote:
> The attached patch is meant to improve icon view line breaks by looking
> for '.', '_' and CamelCase characters, and inserting pango hints that it
> may preferably break at a particular position (i.e. treat it as end of
> word). It is meant to fix bug 300790 [1], while the more interesting
> discussion was going on in bug 323711 [2] between Behdad and myself.
> caveats:
>  - Some developers might not like breaking after CamelCase. It looks
> more aesthetically, but makes FooFooBar indistinguishable from FooFoo
> Bar if we break between the two words. Comments appreciated
>  - The code tries to be smart by only breaking after '.' and '_' if no
> digit follows to not break version information. It seems to work quiet
> well, but needs some testing
>  - The layout is changed when editing a filename that had a manually
> inserted line break. This won't be fixed until [2] is properly resolved
> 
> [1] http://bugzilla.gnome.org/show_bug.cgi?id=300790
> [2] http://bugzilla.gnome.org/show_bug.cgi?id=323711

I like the idea a lot. 

I'm not sure handling CamelCase is right. It may be somewhat surprising
to people. What do other people think about that?

The layout change on rename is unfortunate, but I think this is still
worth it, until we get better support in pango.

About the patch. Could you break out the conversion code to a separate
function, and:
+               zeroified_text = g_malloc ((1 + strlen (ZERO_WIDTH_SPACE)) * (strlen (text) + 1));
looks pretty wasteful to me. Maybe use GString instead (which makes it
easier to read too)?

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a hate-fuelled playboy househusband fleeing from a secret government 
programme. She's a beautiful tempestuous museum curator who dreams of becoming 
Elvis. They fight crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]