Skip to content

Commit

Permalink
ui: complements Trunk Morphic/ToolBuilder updates
Browse files Browse the repository at this point in the history
  • Loading branch information
LinqLover committed Dec 26, 2023
1 parent aef199b commit 734a129
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ collapse
| toDelete |
toDelete := OrderedCollection new.
collapsingNode withSiblingsDo: [:aNode | aNode recursiveAddTo: toDelete].
container noteRemovalOfAll: toDelete].
container noteRemovalOfAll: toDelete.
firstChild := nil].

container noteCollapseOf: self. "<-- TraceDebugger"

self changed.
container noteCollapseOf: self. "<-- TraceDebugger"
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ expand
flag: #proxyHacks;
collect: [:ea | c in: [:p | ea]])
allowSorting: true.
container changed. "See mismatch between #removeAllMorphsIn: and #privateAddAllMorphs:atIndex:"

firstChild := newChildren first.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"class" : {
},
"instance" : {
"collapse" : "ct 7/3/2022 18:14",
"expand" : "ct 7/3/2022 21:00",
"collapse" : "ct 12/26/2023 19:28",
"expand" : "ct 12/26/2023 19:32",
"getIcon" : "ct 7/3/2022 20:56",
"refreshLabel" : "ct 7/1/2022 14:39" } }
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@ update: what
^ self].

what == getSelectedPathSelector ifTrue:[
self selectPath: self getSelectedPath.
self updateSelectedPath.
^ self].

what == getLabelSelector ifTrue: [
self updateAllLabels.
^ self].

what == getIconSelector ifTrue: [ "<-- TraceDebugger"
self updateAllIcons.
^ self].

what == #expandRootsRequested ifTrue: [
self expandRoots.
^ self].

what == self getLabelSelector ifTrue: [ "<-- TraceDebugger"
self items do: [:morph |
morph
refreshLabel;
refreshIcon "rearrange icon"].
self adjustSubmorphPositions].

super update: what.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,39 @@ update: what with: anObject

what == self getLabelSelector ifTrue: [ "<-- TraceDebugger"
(self morphForObject: anObject) ifNotNil: [:morph |
morph
refreshLabel;
refreshIcon "rearrange icon"].
self adjustSubmorphPositions.
morph refreshLabel].
"self adjustSubmorphPositions. --- not required"
^ self "do not refresh remaining items in #update:"].

what == self getIconSelector ifTrue: [ "<-- TraceDebugger"
(self morphForObject: anObject) ifNotNil: [:morph |
morph refreshIcon].
"self adjustSubmorphPositions. --- not required"
^ self "do not refresh remaining items in #update:"].

super update: what with: anObject.

what == #objectChanged ifTrue: [
self updateFromChangedObject: anObject].
^ self updateFromChangedObject: anObject].
what == #expandAllNodesRequested ifTrue: [
"EX: model changed: #expandAllNodesRequested with: #classChildren:."
"EX: model changed: #expandAllNodesRequested with: {#classChildren:. Morph}."
| scope item |
scope := anObject isArray ifTrue: [anObject first] ifFalse: [anObject].
item := anObject isArray ifTrue: [anObject second].
getChildrenSelector == scope ifTrue: [
item
ifNil: [self roots do: [:ea | self expandAll: ea]]
ifNotNil: [self expandAll: (self items detect: [:ea | ea complexContents item == item])].
^ self]].
what == #expandNodeRequested ifTrue: [
"EX: model changed: #expandNodeRequested with: {#classChildren:. Morph}."
| scope item |
scope := anObject first.
item := anObject second.
getChildrenSelector == scope ifTrue: [
self items
detect: [:ea | ea complexContents item == item]
ifFound: [:morph | (morph canExpand and: [morph isExpanded not])
ifTrue: [self toggleExpandedState: morph]].
^ self]].
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*TraceDebugger-UI-updating-pseudo override
updateAllIcons

self items do: [:ea | ea refreshIcon].
"self adjustSubmorphPositions. --- not required"
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
},
"instance" : {
"morphForObject:" : "ct 7/1/2022 14:46",
"update:" : "ct 7/1/2022 22:27",
"update:with:" : "ct 7/3/2022 18:18" } }
"update:" : "ct 12/26/2023 19:44",
"update:with:" : "ct 12/26/2023 19:40",
"updateAllIcons" : "ct 12/26/2023 19:38" } }
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
update: aSymbol
aSymbol == getSelectionSelector
ifTrue:
[self selection: self getCurrentSelectionItem.
[self updateSelection.
^self].
aSymbol == getListSelector
ifTrue:
Expand All @@ -13,6 +13,10 @@ update: aSymbol
[self flag: #moveUpstream.
self expandAllNodes.
^self].
aSymbol == autoExpandSelector
ifTrue:
[self updateAutoExpand.
^self].
((aSymbol isKindOf: Array)
and: [aSymbol notEmpty and: [aSymbol first == #openPath]])
ifTrue:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
"noteExpandOf:expanded:" : "ct 7/3/2022 17:51",
"noteExpandSelector" : "ct 7/3/2022 17:50",
"noteExpandSelector:" : "ct 7/3/2022 17:50",
"update:" : "ct 7/1/2022 14:44" } }
"update:" : "ct 5/12/2023 13:56" } }
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildContextValueTreeWith: builder
name: #contextValueTree;

"icon:"getIconSelector: #contextSliceIconFor:;
update: #contextSliceLabelFor:; "update icons"
update: #contextSliceIconFor:; "update icons"
columns:
((1 to: 2) collect: [:index |
[:listMorph |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ contextSlice: aContextSlice expanded: aBoolean
self contextSlice: child expanded: false]].

self changed: #contextSliceLabelFor: with: aContextSlice.
self changed: #contextSliceIconFor: with: aContextSlice.
self changed: #detailsText.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"buildContentsPane:" : "ct 7/30/2022 19:54",
"buildContentsWith:" : "ct 12/28/2022 15:48",
"buildContextTreeWith:" : "ct 7/4/2022 17:30",
"buildContextValueTreeWith:" : "ct 7/25/2022 01:58",
"buildContextValueTreeWith:" : "ct 12/26/2023 19:43",
"buildControlBarWith:" : "ct 12/28/2022 15:48",
"buildDetailsWith:" : "ct 7/29/2022 18:58",
"buildNavigationBarWith:" : "ct 12/29/2022 02:34",
Expand All @@ -71,7 +71,7 @@
"contextLabelFor:" : "ct 7/30/2022 15:35",
"contextLabelTruncation" : "ct 7/30/2022 16:05",
"contextLabelTruncation:" : "ct 7/30/2022 16:05",
"contextSlice:expanded:" : "ct 7/21/2022 22:04",
"contextSlice:expanded:" : "ct 12/26/2023 19:42",
"contextSliceIconFor:" : "ct 7/1/2022 15:02",
"contextSliceKey:from:event:" : "ct 12/29/2022 02:34",
"contextSliceLabelFor:" : "ct 7/31/2022 21:49",
Expand Down

0 comments on commit 734a129

Please sign in to comment.