[Mono-bugs] [Bug 359098] New: [PATCH] AutoScale fixes for both 2.0 and 1.0 style

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Feb 5 22:58:14 EST 2008


https://bugzilla.novell.com/show_bug.cgi?id=359098


           Summary: [PATCH] AutoScale fixes for both 2.0 and 1.0 style
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: jdpurcell2 at yahoo.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=193330)
 --> (https://bugzilla.novell.com/attachment.cgi?id=193330)
patch

Summary of the changes (note that when I say "should", I mean that's how it's
done in MS.NET):

* ScaleControl should call GetScaledBounds with the control's total size rather
than client size.  GetScaledBounds should handle ignoring the borders in its
calculations.  Cleaned up ScaleControl/GetScaledBounds overrides in controls
(for the most part they just call the base code now since that is fixed).
* Added ScaleChildrenInternal to allow controls to disable scaling of children
without having to override ScaleChildren (since none of .NET's controls do). 
This is required for most controls in Mono that have scrollbars to prevent the
scrollbars from being moved/resized.
* Nested ContainerControls can have a different scale mode than their parent. 
This is briefly mentioned in MSDN but is buggy in MS.NET (the runtime and
designer produce different results both of which look incorrect).
* Default AutoScaleMode for ContainerControl should be Inherit.
* Simplified workaround for ComboBox scaling issue.
* 1.0 style auto-scaling now uses its own methods instead of sharing 2.0's. 
1.0 style auto scaling should scale the whole control's size instead of
ignoring the borders (except for Form) and the rounding is done differently to
preserve control alignment.
* ApplyAutoScaling (used for 1.0 style) should use the rounded result of
GetAutoScaleSize.
* Cleaned up fix for "Bug 355703 - Setting AutoScale = true doesn't stick".
* CurrentAutoScaleDimensions should round the estimated character width instead
of truncating.
* ListBox's GetScaledBounds should always use the height it was set to instead
of the height that was passed in.  This prevents rounding errors from
accumulating quickly with IntegralHeight.

Screenshots comparing 1.0 style auto scaling:

MS.NET:  http://www.jdpurcell.net/misc/mono_scaling/scale1-ms.png
SVN:     http://www.jdpurcell.net/misc/mono_scaling/scale1-svn.png
Patch:   http://www.jdpurcell.net/misc/mono_scaling/scale1-fix.png

2.0 style auto scaling:

MS.NET:  http://www.jdpurcell.net/misc/mono_scaling/scale2-ms.png
SVN:     http://www.jdpurcell.net/misc/mono_scaling/scale2-svn.png
Patch:   http://www.jdpurcell.net/misc/mono_scaling/scale2-fix.png

2.0 style after multiple scalings (6 times, ended up roughly its original
size):

MS.NET:  http://www.jdpurcell.net/misc/mono_scaling/scale2mult-ms.png
SVN:     http://www.jdpurcell.net/misc/mono_scaling/scale2mult-svn.png
Patch:   http://www.jdpurcell.net/misc/mono_scaling/scale2mult-fix.png


-- 
Configure bugmail: https://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