Bug 402165

Summary: Text is not displayed on StatusBarPanel with Center alignment
Product: [Mono] Mono: Class Libraries Reporter: Mike Gratsas <MikeGratsas>
Component: Windows.FormsAssignee: Jonathan Pobst <jpobst>
Status: RESOLVED FIXED QA Contact: Mono Bugs <mono-bugs>
Severity: Normal    
Priority: P5 - None CC: andyhume32
Version: 1.9   
Target Milestone: ---   
Hardware: x86   
OS: Windows XP   
Whiteboard: StatusBar
Found By: Third Party Developer/Partner Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Screenshot
Repro app

Description Mike Gratsas 2008-06-20 14:51:38 UTC
As I see text is not displayed on StatusBarPanel when StatusBarPanel.Alignment = HorizontalAlignment.Center. There is no problems showing text with other alignment values.
Comment 1 Jonathan Pobst 2008-06-23 23:09:03 UTC
Fixed in r106472.  Thanks for the report!

2008-06-23  Jonathan Pobst  <monkey@jpobst.com>

	* ThemeWin32Classic.cs: Fix position calculation for centered
	text on status bar panels.  [Fixes bug #402165]
Comment 2 Andy Hume 2008-06-25 08:22:24 UTC
The problem still occur when it's not the first panel that has center alignment.  See the screenshot where I've also had the code draw a rectangle around the string_rect bounds.  The repro app is attached.

Seems the line needs to be:
  x = area.Left + ((panel.Width - len) / 2);



Two other things are apparent in testing:
1) With text longer than the panel size the start of the text is not displayed in right/center alignment.  That's ok it matches MSFT.

2) Only the first panel is refreshed
-> bug 403599
Comment 3 Andy Hume 2008-06-25 08:23:33 UTC
Created attachment 224207 [details]
Screenshot
Comment 4 Andy Hume 2008-06-25 08:26:47 UTC
Created attachment 224208 [details]
Repro app
Comment 5 Sebastien Pouliot 2008-06-25 11:44:07 UTC
I can't see how this blocks bug #402172 (ImageAttributes.GetAdjustedPalette) ? typo ? 
anyway I removed the association.
Comment 6 Jonathan Pobst 2008-06-25 17:32:18 UTC
Ah, nice followup.  Thanks!  Fixed in r106585.

2008-06-25  Jonathan Pobst  <monkey@jpobst.com>

	* ThemeWin32Classic.cs: Fix from Andy for panel text for panels
	that are not the first panel.
	* StatusBar.cs: Ensure that the X coordinate of panels is always
	stored.  Fix IList implementation of StatusBarPanelCollection to
	call the regular methods.
	[Fixes bug #403599, #402165]