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
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 lecteur@zogotounga.net 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
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
squeak-dev@lists.squeakfoundation.org