[Pkg] The Trunk: Morphic-mt.920.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Apr 24 09:40:55 UTC 2015


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

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

Name: Morphic-mt.920
Author: mt
Time: 24 April 2015, 11:40:15.926 am
UUID: 11ba2879-1956-4844-8e31-12083905d402
Ancestors: Morphic-mt.919

Several magic numbers removed from splitter/grip morph code.

=============== Diff against Morphic-mt.919 ===============

Item was added:
+ ----- Method: AbstractResizerMorph class>>gripThickness (in category 'as yet unclassified') -----
+ gripThickness
+ 	"A number in pixels that encodes the area were the user can target splitters or edge grips."
+ 
+ 	^ 4!

Item was changed:
  ----- Method: BorderedMorph>>addPaneHSplitterBetween:and: (in category 'lookenhancements') -----
  addPaneHSplitterBetween: topMorph and: bottomMorphs
  
  	| targetY minX maxX splitter |
  	targetY := topMorph layoutFrame bottomFraction.
  
  	minX := (bottomMorphs detectMin: [:each | each layoutFrame leftFraction]) layoutFrame leftFraction.
  	maxX := (bottomMorphs detectMax: [:each | each layoutFrame rightFraction]) layoutFrame rightFraction.
  	splitter := ProportionalSplitterMorph new beSplitsTopAndBottom; yourself.
  	splitter layoutFrame: (LayoutFrame
  		fractions: (minX @ targetY corner: maxX @ targetY)
+ 		offsets: (((topMorph layoutFrame leftOffset ifNil: [0]) @ 0 corner: (topMorph layoutFrame rightOffset ifNil: [0]) @ AbstractResizerMorph gripThickness) translateBy: 0 @ (topMorph layoutFrame bottomOffset ifNil: [0]))).
- 		offsets: (((topMorph layoutFrame leftOffset ifNil: [0]) @ 0 corner: (topMorph layoutFrame rightOffset ifNil: [0]) @ 4) translateBy: 0 @ (topMorph layoutFrame bottomOffset ifNil: [0]))).
  
  	self addMorphBack: (splitter position: self position).!

Item was changed:
  ----- Method: BorderedMorph>>addPaneVSplitterBetween:and: (in category 'lookenhancements') -----
  addPaneVSplitterBetween: leftMorph and: rightMorphs 
  
  	| targetX minY maxY splitter |
  	targetX := leftMorph layoutFrame rightFraction.
  	minY := (rightMorphs detectMin: [:each | each layoutFrame topFraction]) layoutFrame topFraction.
  	maxY := (rightMorphs detectMax: [:each | each layoutFrame bottomFraction]) layoutFrame bottomFraction.
  	
  	splitter := ProportionalSplitterMorph new.
  	splitter layoutFrame: (LayoutFrame
  		fractions: (targetX @ minY corner: targetX @ maxY)
+ 		offsets: ((0 @ (leftMorph layoutFrame topOffset ifNil: [0]) corner: (AbstractResizerMorph gripThickness@ (leftMorph layoutFrame bottomOffset ifNil: [0]))) translateBy: (leftMorph layoutFrame rightOffset ifNil: [0]) @ 0)).
- 		offsets: ((0 @ (leftMorph layoutFrame topOffset ifNil: [0]) corner: (4@ (leftMorph layoutFrame bottomOffset ifNil: [0]))) translateBy: (leftMorph layoutFrame rightOffset ifNil: [0]) @ 0)).
  
  	self addMorphBack: (splitter position: self position).!

Item was changed:
  ----- Method: BottomGripMorph>>defaultHeight (in category 'initialize') -----
  defaultHeight
  
+ 	^ self class gripThickness!
- 	^ 5!

Item was changed:
  ----- Method: CornerGripMorph>>defaultHeight (in category 'accessing') -----
  defaultHeight
+ 
+ 	^ self class gripThickness * 6!
- 	^ 22!

Item was changed:
  ----- Method: CornerGripMorph>>defaultWidth (in category 'accessing') -----
  defaultWidth
+ 
+ 	^ self class gripThickness * 6!
- 	^ 22!

Item was changed:
  ----- Method: LeftGripMorph>>defaultWidth (in category 'initialize') -----
  defaultWidth
  
+ 	^ self class gripThickness!
- 	^ 5!

Item was added:
+ ----- Method: ProportionalSplitterMorph>>beSplitsLeftAndRight (in category 'direction') -----
+ beSplitsLeftAndRight
+ 
+ 	splitsTopAndBottom := false.
+ 	self
+ 		hResizing: #rigid;
+ 		vResizing: #spaceFill.
+ 	self width: self class gripThickness.!

Item was changed:
  ----- Method: ProportionalSplitterMorph>>beSplitsTopAndBottom (in category 'direction') -----
  beSplitsTopAndBottom
  
  	splitsTopAndBottom := true.
+ 	self
+ 		vResizing: #rigid;
+ 		hResizing: #spaceFill.
+ 	self height: self class gripThickness.!
- 	!

Item was changed:
  ----- Method: ProportionalSplitterMorph>>initialize (in category 'initialization') -----
  initialize
  
  	super initialize.
  	
+ 	self beSplitsLeftAndRight.
- 	self hResizing: #spaceFill.
- 	self vResizing: #spaceFill.
- 	splitsTopAndBottom := false.
  	
  	leftOrTop := OrderedCollection new.
  	rightOrBottom := OrderedCollection new.
  	
  	Preferences showSplitterHandles 
  		ifTrue: [
  			handle := CircleMorph new
  					borderWidth: 0;
  					extent: 4 at 4;
  					yourself.
  			handle fillStyle: ((GradientFillStyle 
  						ramp: {0.0 -> Preferences defaultWindowColor muchLighter. 
  							1.0 -> Preferences defaultWindowColor darker})
  						origin: handle topLeft;
  						direction: 0 @ handle bounds extent y;
  						normal: handle bounds extent x @ 0;
  						radial: false;
  						yourself).
  			self addMorphCentered: handle].
  	self initializeMovements!

Item was changed:
  ----- Method: RightGripMorph>>defaultWidth (in category 'initialize') -----
  defaultWidth
  
+ 	^ self class gripThickness!
- 	^ 5!

Item was changed:
  ----- Method: SystemWindow class>>borderWidth (in category 'initializing') -----
  borderWidth
  
+ 	^ AbstractResizerMorph gripThickness!
- 	"Making changes to this for some reason requires repositioning of CornerGripMorphs.
- 	Edit BorderedMorph#addCornerGrip and play with offsets to get them right if you increase
- 	border width. For instance, going from 4 to 6 here and you should updated offsets to
- 	(-23 at -23 corner: 0 at 0) for the right placement of corner grips."
- 
- 	^ 4!

Item was changed:
  ----- Method: TopGripMorph>>defaultHeight (in category 'initialize') -----
  defaultHeight
  
+ 	^ self class gripThickness!
- 	^ 5!



More information about the Packages mailing list