GNOME Bugzilla – Bug 508242
Rotated GtkLabel doesn't support ellipses and wrapping
Last modified: 2010-05-22 03:22:35 UTC
GtkLabel explicitly ignores ellipsize and wrapping settings for rotated text. During GUADEC/Extend Layout work I've cooked the attached code to fix the problem.
Created attachment 102447 [details] [review] [PATCH] Support ellipses and wrapping for labels of any angle (#508242). * gtk/gtklabel.h, gtk/gtk.symbols: Add "full-size" property. * gtk/gtklabel.c: Change gtk_label_ensure_layout(), gtk_label_size_request() and gtk_label_size_allocate() to support ellipses and wrapping at any angle. Add "full-size" property. * tests/testellipsise.c: Update to test ellipses at random angles. --- ChangeLog | 10 ++ gtk/gtk.symbols | 2 + gtk/gtklabel.c | 223 +++++++++++++++++++++++++++++++++++++------------ gtk/gtklabel.h | 3 + tests/testellipsise.c | 112 +++++++++++++++++++++++-- 5 files changed, 289 insertions(+), 61 deletions(-)
I absolutely hate the "full-size" property hack for overriding all those width-chars, max-width-chars and screen size based wrapping constraints. Maybe someone has a better idea for expressing that override. Well, or at least a better property name.
The updated version of test/testellipses also exposes bug 508002.
Bah... Cross dependency to natural size stuff: testellipses doesn't show much useful, without natural size support.
Wait a day for pango_layout_set_heigh(). May help.
For reference, pango_layout_set_height() is in pango now. Just that it has some bugs still...
This has been fixed as part of the extended layout work.