A fix for ProportionalSplitterMorph, take 2

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

A fix for ProportionalSplitterMorph, take 2

Stéphane Rollandin
Repeat:

Attached is a fix for ProportionalSplitterMorph.

Currently, moving a window splitter changes all relevant frame layout
offsets; fractions are not touched. But offsets are absolute values, in
pixels, and a frame with a large offset will be badly redimensionned
when the system window extent is reduced.

To see this, open a browser, and move the main horizontal splitter way
up. Then shrink the browser: the code pane will keep a largeish height
(because of its large vertical offsets), and eventually be moved above
the browser top.

To fix this, I propose in the attached changeset to keep track of the
overall splitter delta, then on #mouseUp to recompute the fractions and
reset the offsets to the typical small values they have.

I don't know if I am being clear, but it works... try it.

(the #balanceOffsets method may possibly be simplified I guess)


Stef



ProportionalSplitterMorph.spfa.2.cs (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: A fix for ProportionalSplitterMorph, take 2

David T. Lewis
On Sat, Mar 31, 2018 at 10:47:47AM +0200, St??phane Rollandin wrote:

> Repeat:
>
> Attached is a fix for ProportionalSplitterMorph.
>
> Currently, moving a window splitter changes all relevant frame layout
> offsets; fractions are not touched. But offsets are absolute values, in
> pixels, and a frame with a large offset will be badly redimensionned
> when the system window extent is reduced.
>
> To see this, open a browser, and move the main horizontal splitter way
> up. Then shrink the browser: the code pane will keep a largeish height
> (because of its large vertical offsets), and eventually be moved above
> the browser top.
>
> To fix this, I propose in the attached changeset to keep track of the
> overall splitter delta, then on #mouseUp to recompute the fractions and
> reset the offsets to the typical small values they have.
>
> I don't know if I am being clear, but it works... try it.
>
> (the #balanceOffsets method may possibly be simplified I guess)
>
>
> Stef

This looks good to me. I put it in the inbox (Morphic-dtl.1408) in case any
other review is needed. If no objections I'll move it to trunk soon.

Thanks Stef.

Dave