A fix for ProportionalSplitterMorph

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

A fix for ProportionalSplitterMorph

Stéphane Rollandin
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.1.cs (10K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: A fix for ProportionalSplitterMorph

Chris Muller-3
It blows up quickly when Smart Splitters is turned on (which, BTW,
accidentally avoids this problem you're trying to solve in the first
place  :)   ).

It looked like #fullDelta didn't get set aggressively enough...


On Fri, Mar 30, 2018 at 10:41 AM, Stéphane Rollandin
<[hidden email]> wrote:

> 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
>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: A fix for ProportionalSplitterMorph

Stéphane Rollandin
> It blows up quickly when Smart Splitters is turned on

Right, I did not consider smart splitters.

We just need to add a guard in #repositionBy:

        self setProperty: #fullDelta toValue: ((self valueOfProperty:
#fullDelta) ifNil: [0@0]) + delta.


And, no, smart splitter do not fix the bug I'm addressing here.

Stef