Marcel Taeumel uploaded a new version of ToolBuilder-Morphic to project The Trunk: http://source.squeak.org/trunk/ToolBuilder-Morphic-mt.338.mcz
==================== Summary ====================
Name: ToolBuilder-Morphic-mt.338 Author: mt Time: 17 April 2023, 4:07:37.770908 pm UUID: a45f7878-de1c-a74c-b7ff-4e0087df2a19 Ancestors: ToolBuilder-Morphic-mt.337
In tree widgets, make type-in filter keyboard navigation also work for #all and #visible filter-modes, not just #siblings.
=============== Diff against ToolBuilder-Morphic-mt.337 ===============
Item was changed: ----- Method: PluggableTreeMorph>>collapseAllButSelection (in category 'filtering') ----- collapseAllButSelection "If the filterMode is set to #all, filtering will expand (and collapse) nodes. Thus, it is can be useful to collapse all nodes again but show the current selection to get an overview again when removing the filter." | selectedPath | self fixateSelectionDuring: [ selectedPath := self selectedPath. + selectedMorph := selectedMorphIndex := nil. "Avoid selection update via #collapseAll. See #noteRemovalOfAll:." - selectedMorph := nil. "Avoid selection update via #collapseAll. See #noteRemovalOfAll:." self collapseAll. self selectedPath: selectedPath].!
Item was changed: ----- Method: PluggableTreeMorph>>filterTree (in category 'filtering') ----- filterTree
- | currentParent firstMatch | self filterMode = #siblings ifTrue: [ "For expanded selections, we assume that the user is already looking at the children. This is beneficial for the ObjectExplorer and a useful heuristic in general." self selectedMorph ifNotNil: [:focus | focus isExpanded ifTrue: [self setSelectedMorph: focus firstChild]]]. "Update the filter, try to keep selection stable." self fixateSelectionDuring: [self filterTreeNow]. "Now update selection and scroll position as needed." + self updateSelectionAfterFilter.! - self hoveredMorph: nil. - currentParent := self selectedParentMorph. - firstMatch := currentParent - ifNil: [self roots detect: [:ea | ea visible]] - ifNotNil: [:pm | pm firstVisibleChild]. - self selectedMorph - ifNil: [self scrollToTop] - ifNotNil: [:focus | - focus visible ifFalse: [ - "Select the first match only if current selection does not match anymore." - self setSelectedMorph: firstMatch. - self scrollSelectionAndExtraIntoView. - "Keep parent visible to provide context information. Ensure visibility of current selection." - self scrollSelectionParentIntoView: currentParent]].!
Item was changed: ----- Method: PluggableTreeMorph>>filterTreeButSelection (in category 'filtering') ----- filterTreeButSelection "Similar to #collapseAllButSelection. Apply the filter but make sure the current selection stays unchanged." | selectedPath | self fixateSelectionDuring: [ selectedPath := self selectedPath. + selectedMorph := selectedMorphIndex := nil. "Avoid selection update via #collapseAll. See #noteRemovalOfAll:." - selectedMorph := nil. "Avoid selection update via #collapseAll. See #noteRemovalOfAll:." self filterTree. self selectedPath: selectedPath].!
Item was added: + ----- Method: PluggableTreeMorph>>updateSelectionAfterFilter (in category 'updating') ----- + updateSelectionAfterFilter + "Filter has changed. The current selection might not be visible anymore. Update it accordingly." + + | focus currentParent firstMatch | + self hoveredMorph: nil. + ((focus := self selectedMorph) notNil and: [focus isFilterMatch]) + ifTrue: [^ self "no change, keep view stable"]. + + self filterMode = #siblings + ifTrue: [ "Consider parent for local scope" + firstMatch := (currentParent := self selectedParentMorph) + ifNil: [self roots detect: [:ea | ea visible]] + ifNotNil: [:pm | pm firstVisibleChild]] + ifFalse: [ "#all, #visible -- any filter match will do" + firstMatch := focus + ifNil: [scroller submorphs detect: [:m | m isFilterMatch]] + ifNotNil: [:fm | + scroller submorphs at: (scroller submorphs + findFirst: [:m | m isFilterMatch] + startingAt: self getSelectionIndex)]]. + + "Select the first match only if current selection does not match anymore." + self setSelectedMorph: firstMatch. "New parent for #all or #visible possible" + self scrollSelectionAndExtraIntoView. + + "Keep parent visible to provide context information. Ensure visibility of current selection." + self scrollSelectionParentIntoView: (currentParent ifNil: [self selectedParentMorph]).!
packages@lists.squeakfoundation.org