Hi

I was reading code and I was wondering if we could have a simple NullPlugin to avoid


bottom := self model plugins select: [:each | each position = #bottom ].
    bottom ifEmpty: [ ^ nil ].

and

    bottomMorph := self buildBottomPlugins.
    bottomMorph ifNotNil: [ bottomHeight := bottomMorph height + 8 ].
    aWindow
        addMorph: sourceCodeContainer
        fullFrame:
((0 @ self navigationAreaProportion corner: 1 @ 1) asLayoutFrame
                topOffset: middleHeight;
                bottomOffset: bottomHeight negated).
    bottomMorph
        ifNotNil:
            [ aWindow
                addMorph: bottomMorph
fullFrame: ((0 @ 1 corner: 1 @ 1) asLayoutFrame topOffset: bottomHeight negated).
            bottomMorph color: Color transparent ]

But I do not think that this is the solution. Just brainstorming....

I imagine that we should change the computation to go from

    bottomMorph := self buildBottomPlugins.
    bottomMorph ifNotNil: [ bottomHeight := bottomMorph height + 8 ].
    aWindow
        addMorph: sourceCodeContainer
        fullFrame:
((0 @ self navigationAreaProportion corner: 1 @ 1) asLayoutFrame
                topOffset: middleHeight;
                bottomOffset: bottomHeight negated).
    bottomMorph
        ifNotNil:
            [ aWindow
                addMorph: bottomMorph
fullFrame: ((0 @ 1 corner: 1 @ 1) asLayoutFrame topOffset: bottomHeight negated).
            bottomMorph color: Color transparent ]


into

    bottomMorph := self buildBottomPlugins.
    bottomHeight := bottomMorph height + 8.

     aWindow
        addMorph: sourceCodeContainer
        fullFrame:
((0 @ self navigationAreaProportion corner: 1 @ 1) asLayoutFrame
                topOffset: middleHeight;
                bottomOffset: bottomHeight negated).

    bottomMorph addYourselfInto: aWindow.


and for the Null version
    height returns 0
    addYourselfInto: does nothing.


What do you think?

Stef



Reply via email to