[MonoDevelop] Patch for the docking in MD

IBBoard ibboard at gmail.com
Mon Jan 17 07:49:40 EST 2011


Hi,

I'm not on the MD team, but all patches are normally welcomed. To make
best use of the patch then I'd recommend creating a bug at Bugzilla
(https://bugzilla.novell.com/) and attaching the patch as a proper
diff. That way there is a proper record of it and whoever applies the
patch has a step-by-step use case to check :)

Thanks,

IBBoard

2011/1/17 Vladimir Dimitrov <vlad.dimitrov at gmail.com>:
> Hi all,
>
>
>
> We use the docking code from MD for our projects and have just discovered
> and fixed a bug that is happening when we have a default size of panels set
> to some value, and the docking logic was not respecting it. The case
> happened to be that when a new size is allocated for the DockLayout not all
> of the children items are reallocated.
>
>
>
> So I changed the method CalcNewSizes in DockGroup.cs to end in this way:
>
>
>
>                                                 double expandSize = realSize
> - noexpandSize;
>
>                                                 foreach (DockObject ob in
> VisibleObjects) {
>
>                                                                 if
> (!hasExpandItems)
>
>
> ob.Size = (ob.DefaultSize / noexpandSize) * realSize;
>
>                                                                 else if
> (ob.Expand)
>
>
> ob.Size = (ob.DefaultSize / defaultExpandSize) * expandSize;
>
>                                                                 ob.PrefSize
> = ob.Size;
>
>                                                 }
>
>
>
>                                                 CheckMinSizes ();
>
>
>
>                                                 foreach (DockObject ob in
> VisibleObjects) {
>
>                 DockGroup group = ob as DockGroup;
>
>                 if (group == null)
>
>                     continue;
>
>
>
>                 group.CalcNewSizes ();
>
>                 }
>
>
>
> The added loop recalculates the sizes of the children recursively and this
> fixed the issue on our side, so if anybody is interested in fixing in MD
> this please try the patch.
>
>
>
> Vladimir Dimitrov
>
> _______________________________________________
> Monodevelop-list mailing list
> Monodevelop-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monodevelop-list
>
>


More information about the Monodevelop-list mailing list