Bug 402165 - Text is not displayed on StatusBarPanel with Center alignment
Summary: Text is not displayed on StatusBarPanel with Center alignment
Status: RESOLVED FIXED
Alias: None
Product: Mono: Class Libraries
Classification: Mono
Component: Windows.Forms (show other bugs)
Version: 1.9
Hardware: x86 Windows XP
: P5 - None : Normal
Target Milestone: ---
Assignee: Jonathan Pobst
QA Contact: Mono Bugs
URL:
Whiteboard: StatusBar
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-20 14:51 UTC by Mike Gratsas
Modified: 2008-06-25 17:32 UTC (History)
1 user (show)

See Also:
Found By: Third Party Developer/Partner
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Screenshot (8.37 KB, image/x-png)
2008-06-25 08:23 UTC, Andy Hume
Details
Repro app (3.41 KB, text/plain)
2008-06-25 08:26 UTC, Andy Hume
Details

Note You need to log in before you can comment on or make changes to this bug.
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]