The Inbox: Morphic-cmm.1408.mcz

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

The Inbox: Morphic-cmm.1408.mcz

commits-2
Chris Muller uploaded a new version of Morphic to project The Inbox:
http://source.squeak.org/inbox/Morphic-cmm.1408.mcz

==================== Summary ====================

Name: Morphic-cmm.1408
Author: cmm
Time: 2 April 2018, 6:34:32.944359 pm
UUID: 1b84680b-ad85-4d86-a6d4-29fb3c2f8193
Ancestors: Morphic-cmm.1407

Integrate fix from Stéphane Rollandin that keeps ProportionalSplitter bars in their proportionally-assigned place after resizing windows.

=============== Diff against Morphic-cmm.1407 ===============

Item was added:
+ ----- Method: ProportionalSplitterMorph>>balanceOffsets (in category 'layout') -----
+ balanceOffsets
+
+ self layoutFrame hasFixedHeight ifTrue: [
+ | otop obot ctop cbot topf |
+
+ otop := (owner submorphs detect: [:m |
+ m layoutFrame topFraction isZero] ifNone: [^ self]) in: [:tm |
+ tm top - (tm layoutFrame topOffset ifNil: [0])].
+
+ obot := (owner submorphs detect: [:m |
+ m layoutFrame bottomFraction = 1] ifNone: [^ self]) in: [:tm |
+ tm bottom - (tm layoutFrame bottomOffset ifNil: [0])].
+
+ ctop := (self layoutFrame topFraction * (obot - otop)) rounded
+ + otop + (self layoutFrame topOffset ifNil: [0]).
+ cbot := (self layoutFrame bottomFraction * (obot - otop)) rounded
+ + otop + (self layoutFrame bottomOffset ifNil: [0]).
+
+ topf := self layoutFrame topFraction.
+ self layoutFrame topFraction:  ((ctop + cbot) * 0.5 - otop) / (obot - otop) asFloat.
+ self layoutFrame bottomFraction: self layoutFrame topFraction.
+ self layoutFrame topOffset: ctop -
+ (self layoutFrame topFraction * (obot - otop) + otop) rounded.
+ self layoutFrame bottomOffset: cbot -
+ (self layoutFrame bottomFraction * (obot - otop) + otop) rounded..
+
+ (leftOrTop copy union: rightOrBottom) do: [:m |
+ (m layoutFrame topFraction closeTo: topf) ifTrue: [
+ m layoutFrame topFraction: self layoutFrame topFraction.
+ m layoutFrame topOffset:
+ m layoutFrame topOffset - (self valueOfProperty: #fullDelta) y].
+ (m layoutFrame bottomFraction closeTo: topf) ifTrue: [
+ m layoutFrame bottomFraction: self layoutFrame topFraction.
+ m layoutFrame bottomOffset:
+ m layoutFrame bottomOffset - (self valueOfProperty: #fullDelta) y.]]] .
+
+ self layoutFrame hasFixedWidth ifTrue: [
+ | oleft oright cleft cright leftf |
+
+ oleft := (owner submorphs detect: [:m |
+ m layoutFrame leftFraction isZero] ifNone: [^ self]) in: [:tm |
+ tm left - (tm layoutFrame leftOffset ifNil: [0])].
+
+ oright := (owner submorphs detect: [:m |
+ m layoutFrame rightFraction = 1] ifNone: [^ self]) in: [:tm |
+ tm right - (tm layoutFrame rightOffset ifNil: [0])].
+
+ cleft := (self layoutFrame leftFraction * (oright - oleft)) rounded
+ + oleft + (self layoutFrame leftOffset ifNil: [0]).
+ cright := (self layoutFrame rightFraction * (oright - oleft)) rounded
+ + oleft + (self layoutFrame rightOffset ifNil: [0]).
+
+ leftf := self layoutFrame leftFraction.
+ self layoutFrame leftFraction: ((cleft + cright) * 0.5 - oleft) / (oright - oleft) asFloat.
+ self layoutFrame rightFraction: self layoutFrame leftFraction.
+
+ self layoutFrame leftOffset: cleft -
+ (self layoutFrame leftFraction * (oright - oleft) + oleft) rounded.
+ self layoutFrame rightOffset: cright -
+ (self layoutFrame rightFraction * (oright - oleft) + oleft) rounded.
+
+ (leftOrTop copy union: rightOrBottom) do: [:m |
+ (m layoutFrame leftFraction closeTo: leftf) ifTrue: [
+ m layoutFrame leftFraction: self layoutFrame leftFraction.
+ m layoutFrame leftOffset:
+ m layoutFrame leftOffset - (self valueOfProperty: #fullDelta) x].
+ (m layoutFrame rightFraction closeTo: leftf) ifTrue: [
+ m layoutFrame rightFraction: self layoutFrame leftFraction.
+ m layoutFrame rightOffset:
+ m layoutFrame rightOffset - (self valueOfProperty: #fullDelta) x.]]] .
+
+ self removeProperty: #fullDelta.
+ owner layoutChanged
+ !

Item was changed:
  ----- Method: ProportionalSplitterMorph>>mouseDown: (in category 'events') -----
  mouseDown: anEvent
  "If the user manually drags me, don't override him with auto positioning."
 
+ self setProperty: #fullDelta toValue: 0@0.
+
  anEvent redButtonChanged
  ifTrue: [ self withSiblingSplittersDo: [ : each | each stopStepping ] ]
  ifFalse:
  [ anEvent shiftPressed
  ifTrue: [ self startStepping ]
  ifFalse:
  [ self startStepping.
  self withSiblingSplittersDo: [ : each | each startStepping ] ] ].
  (self class showSplitterHandles not and: [ self bounds containsPoint: anEvent cursorPoint ]) ifTrue:
  [ oldColor := self color.
  self color: Color black ].
  ^ super mouseDown: anEvent!

Item was changed:
  ----- Method: ProportionalSplitterMorph>>mouseUp: (in category 'events') -----
  mouseUp: anEvent
  (self bounds containsPoint: anEvent cursorPoint)
  ifFalse: [anEvent hand showTemporaryCursor: nil].
  self class fastSplitterResize
  ifTrue: [self updateFromEvent: anEvent].
  traceMorph ifNotNil: [traceMorph delete. traceMorph := nil].
+ self color: self getOldColor.
+
+ self balanceOffsets!
- self color: self getOldColor!

Item was changed:
  ----- Method: ProportionalSplitterMorph>>reduceLeftRightImbalance (in category 'layout') -----
  reduceLeftRightImbalance
  | correction |
  correction := self leftRightImbalance.
  correction abs > 1
  ifTrue:
  [ (self proposedCorrectionWouldCauseFocusChange: correction) ifFalse:
  [ self repositionBy:
  (correction abs > 4
  ifTrue: [ correction sign * 2 @ 0 ]
  ifFalse: [ correction sign @ 0 ]) ] ]
  ifFalse:
+ [ self class smartVerticalSplitters ifFalse:
+ [ self
+ stopStepping ;
+ balanceOffsets ] ].
- [ self class smartVerticalSplitters ifFalse: [ self stopStepping ] ].
  ^ correction!

Item was changed:
  ----- Method: ProportionalSplitterMorph>>reduceTopBottomImbalance (in category 'layout') -----
  reduceTopBottomImbalance
  | correction |
  (correction := self topBottomCorrection) isZero
  ifTrue:
+ [ self class smartHorizontalSplitters ifFalse:
+ [ self
+ stopStepping ;
+ balanceOffsets ] ]
- [ self class smartHorizontalSplitters ifFalse: [ self stopStepping ] ]
  ifFalse:
  [ (self proposedCorrectionWouldCauseFocusChange: correction) ifFalse: [ self repositionBy: 0 @ correction ] ].
  ^ correction!

Item was changed:
  ----- Method: ProportionalSplitterMorph>>repositionBy: (in category 'layout') -----
  repositionBy: delta
  | selfTop selfBottom selfLeft selfRight |
+
+ self setProperty: #fullDelta toValue: ((self valueOfProperty: #fullDelta) ifNil: [0@0]) + delta.
+
  leftOrTop do:
  [ : each | | firstRight firstBottom firstLeft firstTop |
  firstRight := each layoutFrame rightOffset ifNil: [ 0 ].
  firstBottom := each layoutFrame bottomOffset ifNil: [ 0 ].
  each layoutFrame rightOffset: firstRight + delta x.
  each layoutFrame bottomOffset: firstBottom + delta y.
  each layoutFrame hasFixedHeight ifTrue: [
  firstTop := each layoutFrame topOffset ifNil: [ 0 ].
  each layoutFrame topOffset: firstTop + delta y ].
  each layoutFrame hasFixedWidth ifTrue: [
  firstLeft := each layoutFrame leftOffset ifNil: [ 0 ].
  each layoutFrame leftOffset: firstLeft + delta x. ] ].
  rightOrBottom do:
  [ : each | | secondLeft secondTop secondRight secondBottom |
  secondLeft := each layoutFrame leftOffset ifNil: [ 0 ].
  secondTop := each layoutFrame topOffset ifNil: [ 0 ].
  each layoutFrame leftOffset: secondLeft + delta x.
  each layoutFrame topOffset: secondTop + delta y.
  each layoutFrame hasFixedHeight ifTrue: [
  secondBottom := each layoutFrame bottomOffset ifNil: [ 0 ].
  each layoutFrame bottomOffset: secondBottom + delta y. ].
  each layoutFrame hasFixedWidth ifTrue: [
  secondRight := each layoutFrame rightOffset ifNil: [ 0 ].
  each layoutFrame rightOffset: secondRight + delta x. ] ].
 
  selfTop := self layoutFrame topOffset ifNil: [ 0 ].
  selfBottom := self layoutFrame bottomOffset ifNil: [ 0 ].
  selfLeft := self layoutFrame leftOffset ifNil: [ 0 ].
  selfRight := self layoutFrame rightOffset ifNil: [ 0 ].
  self layoutFrame
  topOffset: selfTop + delta y ;
  bottomOffset: selfBottom + delta y ;
  leftOffset: selfLeft + delta x ;
  rightOffset: selfRight + delta x.
  self owner layoutChanged.
  self movements removeFirst; add: (splitsTopAndBottom ifTrue: [ delta y sign ] ifFalse: [ delta x sign ])!



Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-cmm.1408.mcz

Chris Muller-3
From only 2 minutes of testing, this updated version appears to fix
the issues I found in "take 2" (both caused by the same problem).

If we don't find any other issues over the next week or so, let's put
it in trunk, it's a nice fix.

 - Chris

On Mon, Apr 2, 2018 at 6:35 PM,  <[hidden email]> wrote:

> Chris Muller uploaded a new version of Morphic to project The Inbox:
> http://source.squeak.org/inbox/Morphic-cmm.1408.mcz
>
> ==================== Summary ====================
>
> Name: Morphic-cmm.1408
> Author: cmm
> Time: 2 April 2018, 6:34:32.944359 pm
> UUID: 1b84680b-ad85-4d86-a6d4-29fb3c2f8193
> Ancestors: Morphic-cmm.1407
>
> Integrate fix from Stéphane Rollandin that keeps ProportionalSplitter bars in their proportionally-assigned place after resizing windows.
>
> =============== Diff against Morphic-cmm.1407 ===============
>
> Item was added:
> + ----- Method: ProportionalSplitterMorph>>balanceOffsets (in category 'layout') -----
> + balanceOffsets
> +
> +       self layoutFrame hasFixedHeight ifTrue: [
> +               | otop obot ctop cbot topf |
> +
> +               otop := (owner submorphs detect: [:m |
> +                                       m layoutFrame topFraction isZero] ifNone: [^ self]) in: [:tm |
> +                                               tm top - (tm layoutFrame topOffset ifNil: [0])].
> +
> +               obot := (owner submorphs detect: [:m |
> +                                       m layoutFrame bottomFraction = 1] ifNone: [^ self]) in: [:tm |
> +                                               tm bottom - (tm layoutFrame bottomOffset ifNil: [0])].
> +
> +               ctop := (self layoutFrame topFraction * (obot - otop)) rounded
> +                                       + otop + (self layoutFrame topOffset ifNil: [0]).
> +               cbot := (self layoutFrame bottomFraction * (obot - otop)) rounded
> +                                       + otop + (self layoutFrame bottomOffset ifNil: [0]).
> +
> +               topf := self layoutFrame topFraction.
> +               self layoutFrame topFraction:  ((ctop + cbot) * 0.5 - otop) / (obot - otop) asFloat.
> +               self layoutFrame bottomFraction: self layoutFrame topFraction.
> +               self layoutFrame topOffset: ctop -
> +                       (self layoutFrame topFraction * (obot - otop) + otop) rounded.
> +               self layoutFrame bottomOffset: cbot -
> +                       (self layoutFrame bottomFraction * (obot - otop) + otop) rounded..
> +
> +               (leftOrTop copy union: rightOrBottom) do: [:m |
> +                       (m layoutFrame topFraction closeTo: topf) ifTrue: [
> +                               m layoutFrame topFraction: self layoutFrame topFraction.
> +                               m layoutFrame topOffset:
> +                                       m layoutFrame topOffset - (self valueOfProperty: #fullDelta) y].
> +                       (m layoutFrame bottomFraction closeTo: topf) ifTrue: [
> +                               m layoutFrame bottomFraction: self layoutFrame topFraction.
> +                               m layoutFrame bottomOffset:
> +                                       m layoutFrame bottomOffset - (self valueOfProperty: #fullDelta) y.]]] .
> +
> +       self layoutFrame hasFixedWidth ifTrue: [
> +               | oleft oright cleft cright leftf |
> +
> +               oleft := (owner submorphs detect: [:m |
> +                       m layoutFrame leftFraction isZero] ifNone: [^ self]) in: [:tm |
> +                               tm left - (tm layoutFrame leftOffset ifNil: [0])].
> +
> +               oright := (owner submorphs detect: [:m |
> +                       m layoutFrame rightFraction = 1] ifNone: [^ self]) in: [:tm |
> +                               tm right - (tm layoutFrame rightOffset ifNil: [0])].
> +
> +               cleft := (self layoutFrame leftFraction * (oright - oleft)) rounded
> +                                       + oleft + (self layoutFrame leftOffset ifNil: [0]).
> +               cright := (self layoutFrame rightFraction * (oright - oleft)) rounded
> +                                       + oleft + (self layoutFrame rightOffset ifNil: [0]).
> +
> +               leftf := self layoutFrame leftFraction.
> +               self layoutFrame leftFraction: ((cleft + cright) * 0.5 - oleft) / (oright - oleft) asFloat.
> +               self layoutFrame rightFraction: self layoutFrame leftFraction.
> +
> +               self layoutFrame leftOffset: cleft -
> +                       (self layoutFrame leftFraction * (oright - oleft) + oleft) rounded.
> +               self layoutFrame rightOffset: cright -
> +                       (self layoutFrame rightFraction * (oright - oleft) + oleft) rounded.
> +
> +               (leftOrTop copy union: rightOrBottom) do: [:m |
> +                       (m layoutFrame leftFraction closeTo: leftf) ifTrue: [
> +                               m layoutFrame leftFraction: self layoutFrame leftFraction.
> +                               m layoutFrame leftOffset:
> +                                       m layoutFrame leftOffset - (self valueOfProperty: #fullDelta) x].
> +                       (m layoutFrame rightFraction closeTo: leftf) ifTrue: [
> +                               m layoutFrame rightFraction: self layoutFrame leftFraction.
> +                               m layoutFrame rightOffset:
> +                                       m layoutFrame rightOffset - (self valueOfProperty: #fullDelta) x.]]] .
> +
> +       self removeProperty: #fullDelta.
> +       owner layoutChanged
> + !
>
> Item was changed:
>   ----- Method: ProportionalSplitterMorph>>mouseDown: (in category 'events') -----
>   mouseDown: anEvent
>         "If the user manually drags me, don't override him with auto positioning."
>
> +       self setProperty: #fullDelta toValue: 0@0.
> +
>         anEvent redButtonChanged
>                 ifTrue: [ self withSiblingSplittersDo: [ : each | each stopStepping ] ]
>                 ifFalse:
>                         [ anEvent shiftPressed
>                                 ifTrue: [ self startStepping ]
>                                 ifFalse:
>                                         [ self startStepping.
>                                         self withSiblingSplittersDo: [ : each | each startStepping ] ] ].
>         (self class showSplitterHandles not and: [ self bounds containsPoint: anEvent cursorPoint ]) ifTrue:
>                 [ oldColor := self color.
>                 self color: Color black ].
>         ^ super mouseDown: anEvent!
>
> Item was changed:
>   ----- Method: ProportionalSplitterMorph>>mouseUp: (in category 'events') -----
>   mouseUp: anEvent
>         (self bounds containsPoint: anEvent cursorPoint)
>                 ifFalse: [anEvent hand showTemporaryCursor: nil].
>         self class fastSplitterResize
>                 ifTrue: [self updateFromEvent: anEvent].
>         traceMorph ifNotNil: [traceMorph delete. traceMorph := nil].
> +       self color: self getOldColor.
> +
> +       self balanceOffsets!
> -       self color: self getOldColor!
>
> Item was changed:
>   ----- Method: ProportionalSplitterMorph>>reduceLeftRightImbalance (in category 'layout') -----
>   reduceLeftRightImbalance
>         | correction |
>         correction := self leftRightImbalance.
>         correction abs > 1
>                 ifTrue:
>                         [ (self proposedCorrectionWouldCauseFocusChange: correction) ifFalse:
>                                 [ self repositionBy:
>                                         (correction abs > 4
>                                                 ifTrue: [ correction sign * 2 @ 0 ]
>                                                 ifFalse: [ correction sign @ 0 ]) ] ]
>                 ifFalse:
> +                       [ self class smartVerticalSplitters ifFalse:
> +                               [ self
> +                                        stopStepping ;
> +                                        balanceOffsets ] ].
> -                       [ self class smartVerticalSplitters ifFalse: [ self stopStepping ] ].
>         ^ correction!
>
> Item was changed:
>   ----- Method: ProportionalSplitterMorph>>reduceTopBottomImbalance (in category 'layout') -----
>   reduceTopBottomImbalance
>         | correction |
>         (correction := self topBottomCorrection) isZero
>                 ifTrue:
> +                       [ self class smartHorizontalSplitters ifFalse:
> +                               [ self
> +                                        stopStepping ;
> +                                        balanceOffsets ] ]
> -                       [ self class smartHorizontalSplitters ifFalse: [ self stopStepping ] ]
>                 ifFalse:
>                         [ (self proposedCorrectionWouldCauseFocusChange: correction) ifFalse: [ self repositionBy: 0 @ correction ] ].
>         ^ correction!
>
> Item was changed:
>   ----- Method: ProportionalSplitterMorph>>repositionBy: (in category 'layout') -----
>   repositionBy: delta
>         | selfTop selfBottom selfLeft selfRight |
> +
> +       self setProperty: #fullDelta toValue: ((self valueOfProperty: #fullDelta) ifNil: [0@0]) + delta.
> +
>         leftOrTop do:
>                 [ : each | | firstRight firstBottom firstLeft firstTop |
>                 firstRight := each layoutFrame rightOffset ifNil: [ 0 ].
>                 firstBottom := each layoutFrame bottomOffset ifNil: [ 0 ].
>                 each layoutFrame rightOffset: firstRight + delta x.
>                 each layoutFrame bottomOffset: firstBottom + delta y.
>                 each layoutFrame hasFixedHeight ifTrue: [
>                         firstTop := each layoutFrame topOffset ifNil: [ 0 ].
>                         each layoutFrame topOffset: firstTop + delta y ].
>                 each layoutFrame hasFixedWidth ifTrue: [
>                         firstLeft := each layoutFrame leftOffset ifNil: [ 0 ].
>                         each layoutFrame leftOffset: firstLeft + delta x. ] ].
>         rightOrBottom do:
>                 [ : each | | secondLeft secondTop secondRight secondBottom |
>                 secondLeft := each layoutFrame leftOffset ifNil: [ 0 ].
>                 secondTop := each layoutFrame topOffset ifNil: [ 0 ].
>                 each layoutFrame leftOffset: secondLeft + delta x.
>                 each layoutFrame topOffset: secondTop + delta y.
>                 each layoutFrame hasFixedHeight ifTrue: [
>                         secondBottom := each layoutFrame bottomOffset ifNil: [ 0 ].
>                         each layoutFrame bottomOffset: secondBottom + delta y. ].
>                 each layoutFrame hasFixedWidth ifTrue: [
>                         secondRight := each layoutFrame rightOffset ifNil: [ 0 ].
>                         each layoutFrame rightOffset: secondRight + delta x. ] ].
>
>         selfTop := self layoutFrame topOffset ifNil: [ 0 ].
>         selfBottom := self layoutFrame bottomOffset ifNil: [ 0 ].
>         selfLeft := self layoutFrame leftOffset ifNil: [ 0 ].
>         selfRight := self layoutFrame rightOffset ifNil: [ 0 ].
>         self layoutFrame
>                  topOffset: selfTop + delta y ;
>                  bottomOffset: selfBottom + delta y ;
>                  leftOffset: selfLeft + delta x ;
>                  rightOffset: selfRight + delta x.
>         self owner layoutChanged.
>         self movements removeFirst; add: (splitsTopAndBottom ifTrue: [ delta y sign ] ifFalse: [ delta x sign ])!
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-cmm.1408.mcz

David T. Lewis
That looks much better, thanks :-)

Dave


On Mon, Apr 02, 2018 at 06:43:41PM -0500, Chris Muller wrote:

> From only 2 minutes of testing, this updated version appears to fix
> the issues I found in "take 2" (both caused by the same problem).
>
> If we don't find any other issues over the next week or so, let's put
> it in trunk, it's a nice fix.
>
>  - Chris
>
> On Mon, Apr 2, 2018 at 6:35 PM,  <[hidden email]> wrote:
> > Chris Muller uploaded a new version of Morphic to project The Inbox:
> > http://source.squeak.org/inbox/Morphic-cmm.1408.mcz
> >
> > ==================== Summary ====================
> >
> > Name: Morphic-cmm.1408
> > Author: cmm
> > Time: 2 April 2018, 6:34:32.944359 pm
> > UUID: 1b84680b-ad85-4d86-a6d4-29fb3c2f8193
> > Ancestors: Morphic-cmm.1407
> >
> > Integrate fix from St??phane Rollandin that keeps ProportionalSplitter bars in their proportionally-assigned place after resizing windows.
> >
> > =============== Diff against Morphic-cmm.1407 ===============
> >
> > Item was added:
> > + ----- Method: ProportionalSplitterMorph>>balanceOffsets (in category 'layout') -----
> > + balanceOffsets
> > +
> > +       self layoutFrame hasFixedHeight ifTrue: [
> > +               | otop obot ctop cbot topf |
> > +
> > +               otop := (owner submorphs detect: [:m |
> > +                                       m layoutFrame topFraction isZero] ifNone: [^ self]) in: [:tm |
> > +                                               tm top - (tm layoutFrame topOffset ifNil: [0])].
> > +
> > +               obot := (owner submorphs detect: [:m |
> > +                                       m layoutFrame bottomFraction = 1] ifNone: [^ self]) in: [:tm |
> > +                                               tm bottom - (tm layoutFrame bottomOffset ifNil: [0])].
> > +
> > +               ctop := (self layoutFrame topFraction * (obot - otop)) rounded
> > +                                       + otop + (self layoutFrame topOffset ifNil: [0]).
> > +               cbot := (self layoutFrame bottomFraction * (obot - otop)) rounded
> > +                                       + otop + (self layoutFrame bottomOffset ifNil: [0]).
> > +
> > +               topf := self layoutFrame topFraction.
> > +               self layoutFrame topFraction:  ((ctop + cbot) * 0.5 - otop) / (obot - otop) asFloat.
> > +               self layoutFrame bottomFraction: self layoutFrame topFraction.
> > +               self layoutFrame topOffset: ctop -
> > +                       (self layoutFrame topFraction * (obot - otop) + otop) rounded.
> > +               self layoutFrame bottomOffset: cbot -
> > +                       (self layoutFrame bottomFraction * (obot - otop) + otop) rounded..
> > +
> > +               (leftOrTop copy union: rightOrBottom) do: [:m |
> > +                       (m layoutFrame topFraction closeTo: topf) ifTrue: [
> > +                               m layoutFrame topFraction: self layoutFrame topFraction.
> > +                               m layoutFrame topOffset:
> > +                                       m layoutFrame topOffset - (self valueOfProperty: #fullDelta) y].
> > +                       (m layoutFrame bottomFraction closeTo: topf) ifTrue: [
> > +                               m layoutFrame bottomFraction: self layoutFrame topFraction.
> > +                               m layoutFrame bottomOffset:
> > +                                       m layoutFrame bottomOffset - (self valueOfProperty: #fullDelta) y.]]] .
> > +
> > +       self layoutFrame hasFixedWidth ifTrue: [
> > +               | oleft oright cleft cright leftf |
> > +
> > +               oleft := (owner submorphs detect: [:m |
> > +                       m layoutFrame leftFraction isZero] ifNone: [^ self]) in: [:tm |
> > +                               tm left - (tm layoutFrame leftOffset ifNil: [0])].
> > +
> > +               oright := (owner submorphs detect: [:m |
> > +                       m layoutFrame rightFraction = 1] ifNone: [^ self]) in: [:tm |
> > +                               tm right - (tm layoutFrame rightOffset ifNil: [0])].
> > +
> > +               cleft := (self layoutFrame leftFraction * (oright - oleft)) rounded
> > +                                       + oleft + (self layoutFrame leftOffset ifNil: [0]).
> > +               cright := (self layoutFrame rightFraction * (oright - oleft)) rounded
> > +                                       + oleft + (self layoutFrame rightOffset ifNil: [0]).
> > +
> > +               leftf := self layoutFrame leftFraction.
> > +               self layoutFrame leftFraction: ((cleft + cright) * 0.5 - oleft) / (oright - oleft) asFloat.
> > +               self layoutFrame rightFraction: self layoutFrame leftFraction.
> > +
> > +               self layoutFrame leftOffset: cleft -
> > +                       (self layoutFrame leftFraction * (oright - oleft) + oleft) rounded.
> > +               self layoutFrame rightOffset: cright -
> > +                       (self layoutFrame rightFraction * (oright - oleft) + oleft) rounded.
> > +
> > +               (leftOrTop copy union: rightOrBottom) do: [:m |
> > +                       (m layoutFrame leftFraction closeTo: leftf) ifTrue: [
> > +                               m layoutFrame leftFraction: self layoutFrame leftFraction.
> > +                               m layoutFrame leftOffset:
> > +                                       m layoutFrame leftOffset - (self valueOfProperty: #fullDelta) x].
> > +                       (m layoutFrame rightFraction closeTo: leftf) ifTrue: [
> > +                               m layoutFrame rightFraction: self layoutFrame leftFraction.
> > +                               m layoutFrame rightOffset:
> > +                                       m layoutFrame rightOffset - (self valueOfProperty: #fullDelta) x.]]] .
> > +
> > +       self removeProperty: #fullDelta.
> > +       owner layoutChanged
> > + !
> >
> > Item was changed:
> >   ----- Method: ProportionalSplitterMorph>>mouseDown: (in category 'events') -----
> >   mouseDown: anEvent
> >         "If the user manually drags me, don't override him with auto positioning."
> >
> > +       self setProperty: #fullDelta toValue: 0@0.
> > +
> >         anEvent redButtonChanged
> >                 ifTrue: [ self withSiblingSplittersDo: [ : each | each stopStepping ] ]
> >                 ifFalse:
> >                         [ anEvent shiftPressed
> >                                 ifTrue: [ self startStepping ]
> >                                 ifFalse:
> >                                         [ self startStepping.
> >                                         self withSiblingSplittersDo: [ : each | each startStepping ] ] ].
> >         (self class showSplitterHandles not and: [ self bounds containsPoint: anEvent cursorPoint ]) ifTrue:
> >                 [ oldColor := self color.
> >                 self color: Color black ].
> >         ^ super mouseDown: anEvent!
> >
> > Item was changed:
> >   ----- Method: ProportionalSplitterMorph>>mouseUp: (in category 'events') -----
> >   mouseUp: anEvent
> >         (self bounds containsPoint: anEvent cursorPoint)
> >                 ifFalse: [anEvent hand showTemporaryCursor: nil].
> >         self class fastSplitterResize
> >                 ifTrue: [self updateFromEvent: anEvent].
> >         traceMorph ifNotNil: [traceMorph delete. traceMorph := nil].
> > +       self color: self getOldColor.
> > +
> > +       self balanceOffsets!
> > -       self color: self getOldColor!
> >
> > Item was changed:
> >   ----- Method: ProportionalSplitterMorph>>reduceLeftRightImbalance (in category 'layout') -----
> >   reduceLeftRightImbalance
> >         | correction |
> >         correction := self leftRightImbalance.
> >         correction abs > 1
> >                 ifTrue:
> >                         [ (self proposedCorrectionWouldCauseFocusChange: correction) ifFalse:
> >                                 [ self repositionBy:
> >                                         (correction abs > 4
> >                                                 ifTrue: [ correction sign * 2 @ 0 ]
> >                                                 ifFalse: [ correction sign @ 0 ]) ] ]
> >                 ifFalse:
> > +                       [ self class smartVerticalSplitters ifFalse:
> > +                               [ self
> > +                                        stopStepping ;
> > +                                        balanceOffsets ] ].
> > -                       [ self class smartVerticalSplitters ifFalse: [ self stopStepping ] ].
> >         ^ correction!
> >
> > Item was changed:
> >   ----- Method: ProportionalSplitterMorph>>reduceTopBottomImbalance (in category 'layout') -----
> >   reduceTopBottomImbalance
> >         | correction |
> >         (correction := self topBottomCorrection) isZero
> >                 ifTrue:
> > +                       [ self class smartHorizontalSplitters ifFalse:
> > +                               [ self
> > +                                        stopStepping ;
> > +                                        balanceOffsets ] ]
> > -                       [ self class smartHorizontalSplitters ifFalse: [ self stopStepping ] ]
> >                 ifFalse:
> >                         [ (self proposedCorrectionWouldCauseFocusChange: correction) ifFalse: [ self repositionBy: 0 @ correction ] ].
> >         ^ correction!
> >
> > Item was changed:
> >   ----- Method: ProportionalSplitterMorph>>repositionBy: (in category 'layout') -----
> >   repositionBy: delta
> >         | selfTop selfBottom selfLeft selfRight |
> > +
> > +       self setProperty: #fullDelta toValue: ((self valueOfProperty: #fullDelta) ifNil: [0@0]) + delta.
> > +
> >         leftOrTop do:
> >                 [ : each | | firstRight firstBottom firstLeft firstTop |
> >                 firstRight := each layoutFrame rightOffset ifNil: [ 0 ].
> >                 firstBottom := each layoutFrame bottomOffset ifNil: [ 0 ].
> >                 each layoutFrame rightOffset: firstRight + delta x.
> >                 each layoutFrame bottomOffset: firstBottom + delta y.
> >                 each layoutFrame hasFixedHeight ifTrue: [
> >                         firstTop := each layoutFrame topOffset ifNil: [ 0 ].
> >                         each layoutFrame topOffset: firstTop + delta y ].
> >                 each layoutFrame hasFixedWidth ifTrue: [
> >                         firstLeft := each layoutFrame leftOffset ifNil: [ 0 ].
> >                         each layoutFrame leftOffset: firstLeft + delta x. ] ].
> >         rightOrBottom do:
> >                 [ : each | | secondLeft secondTop secondRight secondBottom |
> >                 secondLeft := each layoutFrame leftOffset ifNil: [ 0 ].
> >                 secondTop := each layoutFrame topOffset ifNil: [ 0 ].
> >                 each layoutFrame leftOffset: secondLeft + delta x.
> >                 each layoutFrame topOffset: secondTop + delta y.
> >                 each layoutFrame hasFixedHeight ifTrue: [
> >                         secondBottom := each layoutFrame bottomOffset ifNil: [ 0 ].
> >                         each layoutFrame bottomOffset: secondBottom + delta y. ].
> >                 each layoutFrame hasFixedWidth ifTrue: [
> >                         secondRight := each layoutFrame rightOffset ifNil: [ 0 ].
> >                         each layoutFrame rightOffset: secondRight + delta x. ] ].
> >
> >         selfTop := self layoutFrame topOffset ifNil: [ 0 ].
> >         selfBottom := self layoutFrame bottomOffset ifNil: [ 0 ].
> >         selfLeft := self layoutFrame leftOffset ifNil: [ 0 ].
> >         selfRight := self layoutFrame rightOffset ifNil: [ 0 ].
> >         self layoutFrame
> >                  topOffset: selfTop + delta y ;
> >                  bottomOffset: selfBottom + delta y ;
> >                  leftOffset: selfLeft + delta x ;
> >                  rightOffset: selfRight + delta x.
> >         self owner layoutChanged.
> >         self movements removeFirst; add: (splitsTopAndBottom ifTrue: [ delta y sign ] ifFalse: [ delta x sign ])!
> >
> >
> >
> >
>

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-cmm.1408.mcz

David T. Lewis
In reply to this post by commits-2
On Mon, Apr 02, 2018 at 11:35:18PM +0000, [hidden email] wrote:

> Chris Muller uploaded a new version of Morphic to project The Inbox:
> http://source.squeak.org/inbox/Morphic-cmm.1408.mcz
>
> ==================== Summary ====================
>
> Name: Morphic-cmm.1408
> Author: cmm
> Time: 2 April 2018, 6:34:32.944359 pm
> UUID: 1b84680b-ad85-4d86-a6d4-29fb3c2f8193
> Ancestors: Morphic-cmm.1407
>
> Integrate fix from St?phane Rollandin that keeps ProportionalSplitter bars in their proportionally-assigned place after resizing windows.
>
> =============== Diff against Morphic-cmm.1407 ===============
>

Has anyone experienced any problems with this? I will merge to trunk
tomorrow if there are no further concerns.

Dave


Reply | Threaded
Open this post in threaded view
|

Fwd: The Inbox: Morphic-cmm.1408.mcz

Chris Muller-3
If you've already tested it for a full workday with Smart Splitters on
then, sure, go ahead.  I installed it and tested it for 30 seconds but
haven't had a chance to work a full day with it yet, but planning to
do it in the next few days, if you can wait that long.


---------- Forwarded message ----------
From: David T. Lewis <[hidden email]>
Date: Sat, Apr 7, 2018 at 9:57 AM
Subject: Re: [squeak-dev] The Inbox: Morphic-cmm.1408.mcz
To: [hidden email]


On Mon, Apr 02, 2018 at 11:35:18PM +0000, [hidden email] wrote:

> Chris Muller uploaded a new version of Morphic to project The Inbox:
> http://source.squeak.org/inbox/Morphic-cmm.1408.mcz
>
> ==================== Summary ====================
>
> Name: Morphic-cmm.1408
> Author: cmm
> Time: 2 April 2018, 6:34:32.944359 pm
> UUID: 1b84680b-ad85-4d86-a6d4-29fb3c2f8193
> Ancestors: Morphic-cmm.1407
>
> Integrate fix from St?phane Rollandin that keeps ProportionalSplitter bars in their proportionally-assigned place after resizing windows.
>
> =============== Diff against Morphic-cmm.1407 ===============
>

Has anyone experienced any problems with this? I will merge to trunk
tomorrow if there are no further concerns.

Dave

Reply | Threaded
Open this post in threaded view
|

Re: Fwd: The Inbox: Morphic-cmm.1408.mcz

David T. Lewis
On Sat, Apr 07, 2018 at 04:01:17PM -0500, Chris Muller wrote:
> If you've already tested it for a full workday with Smart Splitters on
> then, sure, go ahead.  I installed it and tested it for 30 seconds but
> haven't had a chance to work a full day with it yet, but planning to
> do it in the next few days, if you can wait that long.
>

I don't actually recognize the concept of a "full workday" in Squeak :-)

Dave