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

commits at source.squeak.org commits at source.squeak.org
Thu Nov 5 08:49:25 UTC 2015


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

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

Name: Morphic-mt.1028
Author: mt
Time: 5 November 2015, 9:48:45.933 am
UUID: 21ae1b98-2008-46b6-8855-3c16783c2256
Ancestors: Morphic-mt.1027

Lets tree morphs look more like list morphs regarding selection color and hovering.

=============== Diff against Morphic-mt.1027 ===============

Item was changed:
  ----- Method: ListItemWrapper>>highlightingColor (in category 'accessing') -----
  highlightingColor
  
+ 	^ LazyListMorph listSelectionColor makeForegroundColor!
- 	^MenuMorph menuSelectionColor makeForegroundColor!

Item was changed:
  ScrollPane subclass: #SimpleHierarchicalListMorph
+ 	instanceVariableNames: 'selectedMorph hoveredMorph getListSelector keystrokeActionSelector autoDeselect columns sortingSelector getSelectionSelector setSelectionSelector potentialDropMorph lineColor'
- 	instanceVariableNames: 'selectedMorph getListSelector keystrokeActionSelector autoDeselect columns sortingSelector getSelectionSelector setSelectionSelector potentialDropMorph lineColor'
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'Morphic-Explorer'!
  SimpleHierarchicalListMorph class
  	instanceVariableNames: 'expandedForm notExpandedForm'!
  
  !SimpleHierarchicalListMorph commentStamp: 'ls 3/1/2004 12:15' prior: 0!
  Display a hierarchical list of items.  Each item should be wrapped with a ListItemWrapper.
  
  For a simple example, look at submorphsExample.  For beefier examples, look at ObjectExplorer or FileList2.!
  SimpleHierarchicalListMorph class
  	instanceVariableNames: 'expandedForm notExpandedForm'!

Item was added:
+ ----- Method: SimpleHierarchicalListMorph>>drawHoverOn: (in category 'drawing') -----
+ drawHoverOn: aCanvas 
+ 
+ 	self hoveredMorph ifNil: [^ self].
+ 	PluggableListMorph highlightHoveredRow ifFalse: [^ self].
+ 	
+ 	aCanvas
+ 		fillRectangle: (((scroller transformFrom: self)
+ 				invertBoundsRect: self hoveredMorph bounds)
+ 				intersect: scroller bounds)
+ 		color: (LazyListMorph listSelectionColor darker alpha: 0.3).!

Item was changed:
  ----- Method: SimpleHierarchicalListMorph>>drawOn: (in category 'drawing') -----
  drawOn: aCanvas 
+ 	
  	super drawOn: aCanvas.
+ 	
+ 	self drawHoverOn: aCanvas.
+ 	self drawSelectionOn: aCanvas.
+ 	self drawLinesOn: aCanvas.!
- 	selectedMorph
- 		ifNotNil: [aCanvas
- 				fillRectangle: (((scroller transformFrom: self)
- 						invertBoundsRect: selectedMorph bounds)
- 						intersect: scroller bounds)
- 				color: MenuMorph menuSelectionColor].
- 	self drawLinesOn: aCanvas!

Item was added:
+ ----- Method: SimpleHierarchicalListMorph>>drawSelectionOn: (in category 'drawing') -----
+ drawSelectionOn: aCanvas 
+ 
+ 	self selectedMorph ifNil: [^ self].
+ 	
+ 	aCanvas
+ 		fillRectangle: (((scroller transformFrom: self)
+ 				invertBoundsRect: selectedMorph bounds)
+ 				intersect: scroller bounds)
+ 		color: LazyListMorph listSelectionColor.!

Item was changed:
  ----- Method: SimpleHierarchicalListMorph>>handleMouseMove: (in category 'events-processing') -----
  handleMouseMove: anEvent
  	"Reimplemented because we really want #mouseMove when a morph is dragged around"
  	anEvent wasHandled ifTrue:[^self]. "not interested"
+ 	self hoveredMorph: (self itemFromPoint: anEvent position).
  	(anEvent anyButtonPressed and:[anEvent hand mouseFocus == self]) ifFalse:[^self].
  	anEvent wasHandled: true.
  	self mouseMove: anEvent.
  	(self handlesMouseStillDown: anEvent) ifTrue:[
  		"Step at the new location"
  		self startStepping: #handleMouseStillDown: 
  			at: Time millisecondClockValue
  			arguments: {anEvent copy resetHandlerFields}
  			stepTime: 1].
  !

Item was added:
+ ----- Method: SimpleHierarchicalListMorph>>hoveredMorph (in category 'accessing') -----
+ hoveredMorph
+ 
+ 	^ hoveredMorph!

Item was added:
+ ----- Method: SimpleHierarchicalListMorph>>hoveredMorph: (in category 'accessing') -----
+ hoveredMorph: aMorph
+ 
+ 	hoveredMorph == aMorph ifTrue: [^ self].
+ 	
+ 	hoveredMorph ifNotNil: [:m | m changed].
+ 	hoveredMorph := aMorph.
+ 	hoveredMorph ifNotNil: [:m | m changed].	!



More information about the Squeak-dev mailing list