GNOME Bugzilla – Bug 71742
Improve GtkLabel behavior when it receives a too-small size allocation
Last modified: 2011-02-04 16:11:52 UTC
Yeah, one shouldn't ever get a too-small size but in practice sometimes it matters. The simplest fix is that the X position of the text should be clamped to 0 (never go negative) so that clipping is all on one side of the label. Then eventually ellipsization should automatically kick in if our allocation is too small. Right now the behavior is that both ends of the label are chopped off, which is never useful.
Moving non-critical and hard-to-fix bugs to 2.0.2
Move open bugs from milestones 2.0.[012] -- > 2.0.3, since 2.0.2 is already out.
Created attachment 8126 [details] [review] patch for gtklabel.c
It looks naive, but the attached patch seems to work fine for me.
Needs to do the opposite thing in RTL mode
Created attachment 8927 [details] [review] fix that works with RTL + does the same thing vertically
Created attachment 8929 [details] [review] A version that compiles
Please commit to HEAD. (Probably perfectly fine for 2.0.x, but I'm being conservative right now.)
Applied. I don't think we'll forget about adding ellipsization support to GtkLabel when we have ellipsization support in Pango, so I'm going to close the bug. Mon Aug 5 17:20:45 2002 Owen Taylor <otaylor@redhat.com> * gtk/gtklabel.c: Patch from Soeren Sandmann to improve GtkLabel behavior when it gets a too small allocation. (Always display the initial portion.) (#71742)