[squeak-dev] The Trunk: Morphic-mt.2078.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Jan 26 13:09:33 UTC 2023


Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.2078.mcz

==================== Summary ====================

Name: Morphic-mt.2078
Author: mt
Time: 26 January 2023, 2:09:30.619707 pm
UUID: 02dcfdf2-6b63-4244-8c88-253dd7aa928f
Ancestors: Morphic-mt.2077

In tree widgets, fixes redudant selection updates and thus inadvertent node refresh.

=============== Diff against Morphic-mt.2077 ===============

Item was changed:
  ----- Method: SimpleHierarchicalListMorph>>arrowKey: (in category 'keyboard navigation') -----
  arrowKey: asciiValue
  	"Handle a keyboard navigation character. Answer true if handled, false if not."
  	| keyEvent max oldSelection nextSelection howManyItemsShowing keyHandled |
  	keyHandled := false.
  	keyEvent := asciiValue.
  	max := self maximumSelection.
  	nextSelection := oldSelection := self getSelectionIndex.
       keyEvent = 31 ifTrue:["down"
  		self currentEvent shiftPressed ifTrue: [
  			self selectedMorph nextVisibleSibling
+ 				ifNil: [^ true]
- 				ifNil: [^ false]
  				ifNotNil: [:m | self setSelectedMorph: m. ^ true]].
  		keyHandled := true.
  		nextSelection :=oldSelection + 1.
+ 		nextSelection > max ifTrue: [nextSelection := (self class wrappedNavigation ifTrue: [1] ifFalse: [^ true])]].
- 		nextSelection > max ifTrue: [nextSelection := (self class wrappedNavigation ifTrue: [1] ifFalse: [max])]].
       keyEvent = 30 ifTrue:["up"
  		self currentEvent shiftPressed ifTrue: [
  			self selectedMorph previousVisibleSibling
+ 				ifNil: [^ true]
- 				ifNil: [^ false]
  				ifNotNil: [:m | self setSelectedMorph: m. ^ true]].
  		keyHandled := true.
  		nextSelection := oldSelection - 1.
+ 		nextSelection < 1 ifTrue: [nextSelection := self class wrappedNavigation ifTrue: [max] ifFalse: [^ true]]].
- 		nextSelection < 1 ifTrue: [nextSelection := self class wrappedNavigation ifTrue: [max] ifFalse: [1]]].
       keyEvent = 1  ifTrue: ["home"
  		keyHandled := true.
  		nextSelection := 1].
       keyEvent = 4  ifTrue: ["end"
  		keyHandled := true.
  		nextSelection := max].
  	howManyItemsShowing := self numSelectionsInView.
        keyEvent = 11 ifTrue: ["page up"
  		keyHandled := true.
  		nextSelection := 1 max: oldSelection - howManyItemsShowing].
       keyEvent = 12  ifTrue: ["page down"
  		keyHandled := true.
  		nextSelection := oldSelection + howManyItemsShowing min: max].
  
  	(nextSelection ~= oldSelection or: [ keyHandled and: [ self class wrappedNavigation not ]]) ifTrue: [
  		self setSelectionIndex: nextSelection.
  		^ true].
  	
  	keyEvent = 29 ifTrue:["right"
  		selectedMorph ifNotNil:[
  			(selectedMorph canExpand and:[selectedMorph isExpanded not])
  				ifTrue:[self toggleExpandedState: selectedMorph]
  				ifFalse:[self setSelectionIndex: self getSelectionIndex+1].
  		].
  		^true].
  	keyEvent = 28 ifTrue:["left"
  		selectedMorph ifNotNil:[
  			(selectedMorph isExpanded)
  				ifTrue:[self toggleExpandedState: selectedMorph]
  				ifFalse:[
  					self selectedParentMorph
  						ifNil: [self setSelectionIndex: (self getSelectionIndex-1 max: 1)]
  						ifNotNil: [:pm | self setSelectedMorph: pm]]
  		].
  		^true].
  	^false!



More information about the Squeak-dev mailing list