[squeak-dev] The Trunk: Morphic-mt.2092.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Feb 23 14:13:50 UTC 2023
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.2092.mcz
==================== Summary ====================
Name: Morphic-mt.2092
Author: mt
Time: 23 February 2023, 3:13:48.782976 pm
UUID: b22a193c-cb4d-ef4f-b189-f1ce12cbf7dd
Ancestors: Morphic-mt.2091
Complements ToolBuilder-Morphic-mt.335.
Increase default type-in filter delay to 1500 milliseconds to account for slow typers by default. Fast typers can hit [backspace] any time for faster reset.
=============== Diff against Morphic-mt.2091 ===============
Item was added:
+ ----- Method: IndentingListItemMorph>>applyRecursiveFilter:allowExpand: (in category 'filtering') -----
+ applyRecursiveFilter: filter allowExpand: allowExpand
+
+ | selfMatch childMatch |
+ selfMatch := container matchesPattern: filter contents: contents.
+
+ childMatch := false.
+ (self isExpanded not and: [allowExpand])
+ ifTrue: [self expand].
+ self childrenDo: [:child |
+ (child applyRecursiveFilter: filter allowExpand: allowExpand) ifTrue: [childMatch := true]].
+
+ selfMatch ifTrue: [
+ backgroundColor := FilterBackgroundColor.
+ childMatch ifFalse: [
+ allowExpand
+ ifTrue: [
+ "User is able to expand node again."
+ self collapse]
+ ifFalse: [
+ "Show at least some context for non-matching children."
+ self childrenDo: [:child | child extension visible: true] ]]].
+
+ ^ selfMatch | childMatch
+ ifTrue: [true]
+ ifFalse: [self extension visible: false. false]!
Item was added:
+ ----- Method: IndentingListItemMorph>>applyRecursiveFilter:column:allowExpand: (in category 'filtering') -----
+ applyRecursiveFilter: filter column: index allowExpand: allowExpand
+
+ | selfMatch childMatch |
+ index ifNil: [^ self applyRecursiveFilter: filter allowExpand: allowExpand].
+
+ selfMatch := container matchesPattern: filter contents: contents column: index.
+
+ childMatch := false.
+ (self isExpanded not and: [allowExpand])
+ ifTrue: [self expand].
+ self childrenDo: [:child |
+ (child applyRecursiveFilter: filter column: index allowExpand: allowExpand)
+ ifTrue: [childMatch := true]].
+
+ selfMatch ifTrue: [
+ backgroundColor := FilterBackgroundColor.
+ childMatch ifFalse: [
+ allowExpand
+ ifTrue: [self collapse "User is able to expand node again."]
+ ifFalse: [self childrenDo: [:child | child extension visible: true] ]]].
+
+ ^ selfMatch | childMatch
+ ifTrue: [true]
+ ifFalse: [self extension visible: false. false]!
Item was added:
+ ----- Method: IndentingListItemMorph>>firstChild: (in category 'accessing') -----
+ firstChild: aMorph
+
+ firstChild := aMorph.!
Item was changed:
----- Method: IndentingListItemMorph>>initializeFromText: (in category 'initialization') -----
initializeFromText: aText
"Overridden to keep track of text-based attributes."
| priorFont priorEmphasis priorColor |
priorFont := self font.
priorEmphasis := self emphasis.
priorColor := self color.
super initializeFromText: aText.
self setProperty: #hasFontFromText toValue: priorFont ~~ self font.
+ self setProperty: #hasEmphasisFromText toValue: priorEmphasis ~~ self emphasis.
- self setProperty: #hasEmphasisFromText toValue: priorFont ~~ self emphasis.
self setProperty: #hasColorFromText toValue: priorColor ~~ self color.!
Item was changed:
----- Method: PluggableListMorph class>>clearFilterDelay (in category 'preferences') -----
clearFilterDelay
<preference: 'Filterable Lists Clear Delay'
category: 'scrolling'
description: 'Defines the maximum delay (in milliseconds) between keystrokes before the filter expression is cleared again.'
type: #Number>
+ ^ ClearFilterDelay ifNil: [1500]!
- ^ ClearFilterDelay ifNil: [500]!
Item was added:
+ ----- Method: SimpleHierarchicalListMorph>>collapseAll (in category 'events') -----
+ collapseAll
+ "Do not use #collapse for each child to avoid intermediate layout updates."
+
+ | orphans |
+ orphans := OrderedCollection new.
+ self roots do: [:ea |
+ ea isExpanded: false.
+ ea firstChild ifNotNil: [:child | child withSiblingsDo: [:node | node recursiveAddTo: orphans]].
+ ea firstChild: nil].
+ self noteRemovalOfAll: orphans.
+
+ self adjustSubmorphPositions.!
Item was changed:
----- Method: SimpleHierarchicalListMorph>>expandAll (in category 'events') -----
expandAll
+
+ selectedMorph ifNil: [^ self].
- (selectedMorph isNil
- or: [selectedMorph isExpanded])
- ifTrue: [^self].
self expandAll: selectedMorph.
self adjustSubmorphPositions!
Item was changed:
----- Method: SimpleHierarchicalListMorph>>expandAll: (in category 'events') -----
expandAll: aMorph
+
+ aMorph canExpand ifFalse: [^ self].
+ aMorph isExpanded ifFalse: [aMorph toggleExpandedState].
+ aMorph childrenDo: [:child | self expandAll: child].!
- | allChildren |
- aMorph toggleExpandedState.
- allChildren := OrderedCollection new: 10.
- aMorph recursiveAddTo: allChildren.
- allChildren do: [:each |
- (each canExpand and: [each isExpanded not])
- ifTrue: [self expandAll: each]].
- !
Item was changed:
----- Method: SimpleHierarchicalListMorph>>itemFromPoint: (in category 'event handling') -----
itemFromPoint: aPoint
"Return the list element (morph) at the given point or nil if outside"
| ptY visibleRows |
scroller hasSubmorphs ifFalse:[^nil].
(scroller fullBounds containsPoint: aPoint) ifFalse:[^nil].
visibleRows := scroller submorphs select: [:m | m visible].
ptY := (visibleRows first point: aPoint from: self) y.
"note: following assumes that submorphs are vertical, non-overlapping, and ordered"
visibleRows first top > ptY ifTrue:[^nil].
+ visibleRows last bottom < ptY ifTrue:[^visibleRows last].
- visibleRows last bottom < ptY ifTrue:[^nil].
"now use binary search"
^visibleRows
findBinary:[:item|
(item top <= ptY and:[item bottom >= ptY])
ifTrue:[0] "found"
ifFalse:[ (item top + item bottom // 2) > ptY ifTrue:[-1] ifFalse:[1]]]
ifNone: [nil]!
Item was changed:
----- Method: SimpleHierarchicalListMorph>>update: (in category 'updating') -----
update: aSymbol
aSymbol == getSelectionSelector
ifTrue:
+ [self updateSelection.
- [self selection: self getCurrentSelectionItem.
^self].
aSymbol == getListSelector
ifTrue:
[self list: self getList.
^self].
((aSymbol isKindOf: Array)
and: [aSymbol notEmpty and: [aSymbol first == #openPath]])
ifTrue:
[^(scroller submorphs at: 1 ifAbsent: [^self])
openPath: aSymbol allButFirst]!
Item was added:
+ ----- Method: SimpleHierarchicalListMorph>>updateSelection (in category 'updating') -----
+ updateSelection
+ "Fetch selected item from the model."
+
+ self selection: self getCurrentSelectionItem.!
More information about the Squeak-dev
mailing list
|