Skip to content

Commit

Permalink
removing the notifyAllChildrenRecursivelyThatParentHasReLayouted and …
Browse files Browse the repository at this point in the history
…the parentHasReLayouted methods as they are no longer needed
  • Loading branch information
davidedc committed Aug 7, 2020
1 parent b4b2647 commit cbbcee5
Show file tree
Hide file tree
Showing 42 changed files with 7 additions and 123 deletions.
2 changes: 0 additions & 2 deletions src/BasementWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ class BasementWdgt extends BoxMorph

if @isCollapsed()
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()
return

@rawSetBounds newBoundsForThisLayout
Expand Down Expand Up @@ -191,4 +190,3 @@ class BasementWdgt extends BoxMorph

super
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()
2 changes: 0 additions & 2 deletions src/CodePromptMorph.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ class CodePromptMorph extends Widget

if @isCollapsed()
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()
return

# here we are disabling all the broken
Expand Down Expand Up @@ -146,5 +145,4 @@ class CodePromptMorph extends Widget

super
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()

2 changes: 0 additions & 2 deletions src/ColorPickerMorph.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ class ColorPickerMorph extends Widget

if @isCollapsed()
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()
return

# here we are disabling all the broken
Expand Down Expand Up @@ -96,7 +95,6 @@ class ColorPickerMorph extends Widget

super
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()

if Automator? and Automator.state != Automator.IDLE and Automator.alignmentOfMorphIDsMechanism
world.alignIDsOfNextMorphsInSystemTests()
2 changes: 0 additions & 2 deletions src/EmptyButtonMorph.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ class EmptyButtonMorph extends Widget

if @isCollapsed()
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()
return

@rawSetBounds newBoundsForThisLayout
Expand All @@ -96,7 +95,6 @@ class EmptyButtonMorph extends Widget

super
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()

# TODO
getTextDescription: ->
Expand Down
3 changes: 0 additions & 3 deletions src/ErrorsLogViewerMorph.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ class ErrorsLogViewerMorph extends Widget

if @isCollapsed()
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()
return

@rawSetBounds newBoundsForThisLayout
Expand Down Expand Up @@ -181,6 +180,4 @@ class ErrorsLogViewerMorph extends Widget

super
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()


2 changes: 1 addition & 1 deletion src/HandleMorph.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class HandleMorph extends Widget
switch @type
# 1. all these changes applied to the target are all deferred
# 2. the position of this handle will be changed when the
# parentHasReLayouted method of this handle will be called
# doLayout method of the parent of the handle will be called
# ...i.e. *after* the parent has re-layouted (in the deferred layout phase).
when "resizeBothDimensionsHandle"
newExt = newPos.add(@extent().add(@inset)).subtract @target.position()
Expand Down
1 change: 0 additions & 1 deletion src/PromptMorph.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ class PromptMorph extends MenuMorph
reLayout: ->
super()
@buildSubmorphs()
@notifyAllChildrenRecursivelyThatParentHasReLayouted()

buildSubmorphs: ->

Expand Down
1 change: 0 additions & 1 deletion src/SaveShortcutPromptWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class SaveShortcutPromptWdgt extends MenuMorph
reLayout: ->
super()
@buildSubmorphs()
@notifyAllChildrenRecursivelyThatParentHasReLayouted()

buildSubmorphs: ->

Expand Down
2 changes: 0 additions & 2 deletions src/ScriptWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ class ScriptWdgt extends Widget

if @isCollapsed()
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()
return

# here we are disabling all the broken
Expand Down Expand Up @@ -155,5 +154,4 @@ class ScriptWdgt extends Widget

super
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()

2 changes: 0 additions & 2 deletions src/SimpleLinkWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ class SimpleLinkWdgt extends Widget

if @isCollapsed()
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()
return

# here we are disabling all the broken
Expand Down Expand Up @@ -102,5 +101,4 @@ class SimpleLinkWdgt extends Widget

super
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()

2 changes: 0 additions & 2 deletions src/SimplePlainTextWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,3 @@ class SimplePlainTextWdgt extends TextMorph2
@silentRawSetExtent new Point width, height

@changed()
@notifyAllChildrenRecursivelyThatParentHasReLayouted()

2 changes: 0 additions & 2 deletions src/SpeechBubbleWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ class SpeechBubbleWdgt extends Widget

if @isCollapsed()
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()
return

# here we are disabling all the broken
Expand Down Expand Up @@ -103,7 +102,6 @@ class SpeechBubbleWdgt extends Widget

super
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()

if Automator? and Automator.state != Automator.IDLE and Automator.alignmentOfMorphIDsMechanism
world.alignIDsOfNextMorphsInSystemTests()
Expand Down
2 changes: 0 additions & 2 deletions src/StretchableCanvasWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ class StretchableCanvasWdgt extends CanvasMorph

if @isCollapsed()
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()
return

# here we are disabling all the broken
Expand All @@ -215,7 +214,6 @@ class StretchableCanvasWdgt extends CanvasMorph

super
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()

if Automator? and Automator.state != Automator.IDLE and Automator.alignmentOfMorphIDsMechanism
world.alignIDsOfNextMorphsInSystemTests()
1 change: 0 additions & 1 deletion src/StretchableEditableWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ class StretchableEditableWdgt extends Widget
world.alignIDsOfNextMorphsInSystemTests()

@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()

rawSetExtent: (aPoint) ->
super
Expand Down
2 changes: 0 additions & 2 deletions src/StretchablePanelWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class StretchablePanelWdgt extends PanelWdgt

if @isCollapsed()
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()
return

# here we are disabling all the broken
Expand Down Expand Up @@ -79,7 +78,6 @@ class StretchablePanelWdgt extends PanelWdgt

super
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()

if Automator? and Automator.state != Automator.IDLE and Automator.alignmentOfMorphIDsMechanism
world.alignIDsOfNextMorphsInSystemTests()
Expand Down
2 changes: 0 additions & 2 deletions src/StretchableWidgetContainerWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ class StretchableWidgetContainerWdgt extends Widget

if @isCollapsed()
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()
return

#console.log "spanel @contents: " + @contents + " doLayout 2"
Expand Down Expand Up @@ -175,7 +174,6 @@ class StretchableWidgetContainerWdgt extends Widget

super
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()

if Automator? and Automator.state != Automator.IDLE and Automator.alignmentOfMorphIDsMechanism
world.alignIDsOfNextMorphsInSystemTests()
Expand Down
2 changes: 0 additions & 2 deletions src/WidgetHolderWithCaptionWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ class WidgetHolderWithCaptionWdgt extends Widget

if @isCollapsed()
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()
return

@rawSetBounds newBoundsForThisLayout
Expand Down Expand Up @@ -107,7 +106,6 @@ class WidgetHolderWithCaptionWdgt extends Widget

super
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()

if Automator? and Automator.state != Automator.IDLE and Automator.alignmentOfMorphIDsMechanism
world.alignIDsOfNextMorphsInSystemTests()
2 changes: 0 additions & 2 deletions src/apps/DashboardsWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,4 @@ class DashboardsWdgt extends StretchableEditableWdgt
world.alignIDsOfNextMorphsInSystemTests()

@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()


2 changes: 0 additions & 2 deletions src/apps/PatchProgrammingWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,4 @@ class PatchProgrammingWdgt extends StretchableEditableWdgt
world.alignIDsOfNextMorphsInSystemTests()

@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()


1 change: 0 additions & 1 deletion src/apps/ReconfigurablePaintWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -508,5 +508,4 @@ class ReconfigurablePaintWdgt extends StretchableEditableWdgt
world.alignIDsOfNextMorphsInSystemTests()

@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()

2 changes: 0 additions & 2 deletions src/apps/SimpleDocumentWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ class SimpleDocumentWdgt extends Widget

if @isCollapsed()
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()
return

# here we are disabling all the broken
Expand Down Expand Up @@ -175,7 +174,6 @@ class SimpleDocumentWdgt extends Widget

super
@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()

# same as simpledocumentscrollpanel, you can lock the contents.
# worth factoring it out as a mixin?
Expand Down
2 changes: 0 additions & 2 deletions src/apps/SimpleSlideWdgt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,4 @@ class SimpleSlideWdgt extends StretchableEditableWdgt
world.alignIDsOfNextMorphsInSystemTests()

@layoutIsValid = true
@notifyAllChildrenRecursivelyThatParentHasReLayouted()


2 changes: 0 additions & 2 deletions src/basic-widgets/SliderButtonMorph.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ class SliderButtonMorph extends CircleBoxMorph

@silentFullRawMoveTo new Point(posX, posY).add @parent.position()

@notifyAllChildrenRecursivelyThatParentHasReLayouted()

grabsToParentWhenDragged: ->
if @parent instanceof SliderMorph
return false
Expand Down
2 changes: 0 additions & 2 deletions src/basic-widgets/StringFieldMorph.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ class StringFieldMorph extends PanelWdgt
@add @text
@text.fullRawMoveTo @position()
@silentRawSetExtent new Point Math.max(@width(), @minTextWidth), @text.height()
@notifyAllChildrenRecursivelyThatParentHasReLayouted()


getValue: ->
@text.text
Expand Down
2 changes: 0 additions & 2 deletions src/basic-widgets/StringFieldWdgt2.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ class StringFieldWdgt2 extends PanelWdgt
@text.fullRawMoveTo @position().add new Point 5,2
@text.rawSetExtent new Point 300, 18
@silentRawSetExtent new Point @width(), 18
@notifyAllChildrenRecursivelyThatParentHasReLayouted()


getValue: ->
@text.text
Expand Down
1 change: 0 additions & 1 deletion src/basic-widgets/StringMorph.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ class StringMorph extends Widget
super()
width = @widthOfText @text
@silentRawSetExtent new Point width, fontHeight @fontSize
@notifyAllChildrenRecursivelyThatParentHasReLayouted()

reflowText: ->
@reLayout()
Expand Down
1 change: 0 additions & 1 deletion src/basic-widgets/TextMorph.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ class TextMorph extends StringMorph
@silentRawSetExtent new Point @maxLineWidth + shadowWidth, height
else
@silentRawSetExtent new Point @maxTextWidth + shadowWidth, height
@notifyAllChildrenRecursivelyThatParentHasReLayouted()

# no changes of position or extent should be
# performed in here
Expand Down
11 changes: 5 additions & 6 deletions src/basic-widgets/TriggerMorph.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,9 @@ class TriggerMorph extends Widget

@color = WorldMorph.preferencesAndSettings.menuBackgroundColor
if @labelString?
@layoutSubmorphs()
@reLayout()

layoutSubmorphs: (morphStartingTheChange = nil) ->
super()
reLayout: ->
if not @label?
@createLabel()
if @centered
Expand All @@ -105,18 +104,18 @@ class TriggerMorph extends Widget
# from scratch
if @label?
@label = @label.fullDestroy()
@layoutSubmorphs()
@reLayout()
# this part is excluded from the fizzygum homepage build <<«

alignCenter: ->
if !@centered
@centered = true
@layoutSubmorphs()
@reLayout()

alignLeft: ->
if @centered
@centered = false
@layoutSubmorphs()
@reLayout()


# This method only paints this very morph's "image",
Expand Down
Loading

0 comments on commit cbbcee5

Please sign in to comment.