Tests for GtkCellRendererText



Hi,

I just committed a new gtk+/tests/testcellrenderertext.c.  The program
creates a treeview that displays several rows, and each row uses
different values for GtkCellRendererText's many attributes.

Load the program, maximize the window, and resize the "Test" column to
be much wider than the text in it, so that you can see the alignments.

In the top treeview ("left to right"):

- Look at row 2. The Arabic text is not centered.
- Look at row 3. Since xalign=1.0, shouldn't the Arabic line be all the
way to the *left* of the cell?

In the bottom treeview ("right to left"):

- Look at row 1.  The Arabic text should be at the right.
- Look at row 2.  None of the lines are centered, and they should be.
- Look at row 3.  Again, xalign=1.0.  Shouldn't the English text be at
the *left*, since this is a RTL widget?

Ignore the apples --- they are there to make the cells taller than the
text, and that way I can see whether yalign is working.

I wrote these tests because I think GtkCellRendererText is (re)measuring
text more than needed.  It creates its PangoLayout, calls
pango_layout_get_extents() on it, then changes some other properties in
the layout; this last thing causes the layout to be re-measured when
painting it.  This is for my file chooser profiling stuff --- if I can
cut down on re-measuring, I think I can shave off 1/2 or 1/3 of the time
spent measuring text in the file chooser; that is what shows up at the
top of the profiles.

  Federico




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