[Mono-bugs] [Bug 599841] TabControl / TabPage Text and Image should be centered when SizeMode = Fixed

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Apr 28 04:53:03 EDT 2010



Thomas Goldstein <stifu at free.fr> changed:

           What    |Removed                     |Added
 Attachment #357083|0                           |1
        is obsolete|                            |

--- Comment #7 from Thomas Goldstein <stifu at free.fr> 2010-04-28 08:53:02 UTC ---
Created an attachment (id=357315)
 --> (http://bugzilla.novell.com/attachment.cgi?id=357315)
Patch 2

Just a little update to the patch above:

1- It changes: defaultFormatting.LineAlignment = StringAlignment.Near;
to: defaultFormatting.LineAlignment = StringAlignment.Center;
This is needed to center the tab text vertically (which is needed when the
ItemSize.Height value of the TabControl is high enough, else the text stays at
the top of the big tab)
2- This changes the way image_x is initialized, when SizeMode is Fixed. It
makes more sense this way, and matches the way image_y is initialized.

However, I found a regression caused by my patch(es): due to the fact texts are
now centered horizontally, this causes clipping to go wrong in some cases, and
so the right of some texts can be truncated (just for non-selected tabs, it
This behavior can be seen in the test case of comment 4, for example. Run it,
select the 2nd top tab, and you'll see the text of the first tab will end as
"Norma" rather than "Normal", the L gets eaten by the clipping.

I'm not sure how to fix this properly, so I'll leave this to you guys from
here. I think some problems may come from the fact that the interior
(Rectangle) variable isn't properly initialized. Also, it seems Padding is not
properly handled either (give a big Padding to a TabControl, and things will go
wrong with Mono, not with .NET...).

Sorry if this is all confusing, but I just keep getting into a new bug after
another. :)

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list