[squeak-dev] The Trunk: Morphic-ar.211.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Oct 14 02:49:08 UTC 2009


Andreas Raab uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ar.211.mcz

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

Name: Morphic-ar.211
Author: ar
Time: 13 October 2009, 7:47:26 am
UUID: 6d96961f-af8e-304a-90d7-a82d996bfffe
Ancestors: Morphic-MAD.206, Morphic-MAD.210

Merging Morphic-MAD.206, Morphic-MAD.210:

Small UI tweaks:
Lazy list now uses new selection color.
System Window label is grayed for non-active windows.
Pluggable Button Morphs were ignoring standardButtonFont preference.

=============== Diff against Morphic-MAD.205 ===============

Item was changed:
  ----- Method: SystemProgressMorph class>>initialize (in category 'class initialization') -----
  initialize
  	"SystemProgressMorph initialize; reset"
  	BarHeight := 8.
+ 	BarWidth := 300.
+ 	Inset := 30 at 30!
- 	BarWidth := 300!

Item was changed:
  ----- Method: SystemWindow>>activateWindow (in category 'top window') -----
  activateWindow
  	"Bring me to the front and make me able to respond to mouse and keyboard.
  	Was #activate (sw 5/18/2001 23:20)"
  
  	| oldTop outerMorph sketchEditor pal |
  	outerMorph := self topRendererOrSelf.
  	outerMorph owner ifNil: [^ self "avoid spurious activate when drop in trash"].
  	oldTop := TopWindow.
  	oldTop = self ifTrue: [^self].
  	TopWindow := self.
  	oldTop ifNotNil: [oldTop passivate].
  	outerMorph owner firstSubmorph == outerMorph
  		ifFalse: ["Bring me (with any flex) to the top if not already"
  				outerMorph owner addMorphFront: outerMorph].
  	self submorphsDo: [:m | m unlock].
+ 
+ 	label ifNotNil: [label color: Color black].
+ 
  	labelArea ifNotNil:
  		[labelArea submorphsDo: [:m | m unlock].
  		self setStripeColorsFrom: self paneColorToUse].
  	self isCollapsed ifFalse:
  		[model modelWakeUpIn: self.
  		self positionSubmorphs.
  		labelArea ifNil: [self adjustBorderUponActivationWhenLabeless]].
  
  	(sketchEditor := self extantSketchEditor) ifNotNil:
  		[sketchEditor comeToFront.
  		(pal := self world findA: PaintBoxMorph) ifNotNil:
  			[pal comeToFront]].
  !

Item was changed:
  ----- Method: LazyListMorph>>drawBackgroundForMulti:on: (in category 'drawing') -----
  drawBackgroundForMulti: row on: aCanvas
+ 	| selectionDrawBounds thisColor |
+ 	"shade the background paler, if this row is selected, but not the current selected row"
+ 	thisColor := selectedRow = row
+ 				ifTrue: [Preferences menuSelectionColor]
+ 				ifFalse: [Preferences menuSelectionColor muchLighter].
- 	| selectionDrawBounds |
- 	"shade the background darker, if this row is selected"
- 
  	selectionDrawBounds := self drawBoundsForRow: row.
  	selectionDrawBounds := selectionDrawBounds intersect: self bounds.
+ 	aCanvas fillRectangle: selectionDrawBounds color: thisColor!
- 	aCanvas fillRectangle: selectionDrawBounds color:  self color muchLighter!

Item was changed:
  RectangleMorph subclass: #SystemProgressMorph
  	instanceVariableNames: 'activeSlots bars labels font lock'
+ 	classVariableNames: 'BarHeight BarWidth Inset UniqueInstance'
- 	classVariableNames: 'BarHeight BarWidth UniqueInstance'
  	poolDictionaries: ''
  	category: 'Morphic-Widgets'!
  
  !SystemProgressMorph commentStamp: '<historical>' prior: 0!
  An single instance of this morph class is used to display progress while the system is busy, eg. while it receives code updates or does a fileIn. To give the user progress information you don't deal directly with SystemProgressMorph. You keep on using the well established way of progress notification, that has been a long time in the system, is widely used and does not depend on the existence of SystemProgressMorph. For more information on this look at the example in this class or look at the comment of the method displayProgressAt:from:to:during: in class String.
  
  SystemProgressMorph is not meant to be used as a component inside other morphs.
  
  You can switch back to the old style of progress display by disabling the morphicProgressStyle setting in the morphic section of the preferences.!

Item was changed:
  ----- Method: SystemWindow>>passivate (in category 'top window') -----
  passivate
  	"Make me unable to respond to mouse and keyboard"
  
+ 	label ifNotNil: [label color: Color darkGray].
  	self setStripeColorsFrom: self paneColorToUse.
  	model modelSleep.
  
  	"Control boxes remain active, except in novice mode"
  	self submorphsDo: [:m |
  		m == labelArea ifFalse:
  			[m lock]].
  	labelArea ifNotNil:
  		[labelArea submorphsDo: [:m |
  			(m == closeBox or: [m == collapseBox])
  				ifTrue:
  					[Preferences noviceMode ifTrue: [m lock]]
  				ifFalse:
  					[m lock]]]
  		ifNil: "i.e. label area is nil, so we're titleless"
  			[self adjustBorderUponDeactivationWhenLabeless].
  !

Item was changed:
  ----- Method: SystemProgressMorph>>recenter (in category 'private') -----
  recenter
+ 	| position |
+ 	"Put ourself in the center of the display"
  	self align: self fullBounds center with: Display boundingBox center.
+ 	"Check to see if labels are wider than progress bars. In that case do
+ 	a centered instead of the default left aligned layout."
+ 	position :=	self width > (Inset x * 2 + (self borderWidth * 2) + BarWidth)
+ 					ifTrue: [#topCenter]
+ 					ifFalse: [#leftCenter].
+ 	self cellPositioning: position!
- !

Item was changed:
  ----- Method: SystemProgressMorph>>initialize (in category 'initialization') -----
  initialize
  	super initialize.
  	activeSlots := 0.
  	bars := Array new: 10.
  	labels := Array new: 10.
  	font := Preferences standardMenuFont.
  	lock := Semaphore forMutualExclusion.
  	self setDefaultParameters;
  		setProperty: #morphicLayerNumber toValue: self morphicLayerNumber;
  		layoutPolicy: TableLayout new;
  		listDirection: #topToBottom;
  		cellPositioning: #leftCenter;
  		cellInset: 5;
  		listCentering: #center;
  		hResizing: #shrinkWrap;
  		vResizing: #shrinkWrap;
+ 		layoutInset: Inset;
- 		layoutInset:30 at 30;
  		minWidth: 150!

Item was changed:
  ----- Method: PluggableButtonMorph>>label: (in category 'accessing') -----
  label: aStringOrTextOrMorph
+ 	self label: aStringOrTextOrMorph font: Preferences standardButtonFont  !
- 	"Label this button with the given string or morph."
- 
- 	| r |
- 	self removeAllMorphs.
- 	"nest label in a row for centering"
- 	r := AlignmentMorph newRow
- 		borderWidth: 0;
- 		layoutInset: 0;
- 		color: Color transparent;
- 		hResizing: #shrinkWrap;
- 		vResizing: #spaceFill;
- 		wrapCentering: #center; cellPositioning: #leftCenter.
- 	aStringOrTextOrMorph isMorph
- 		ifTrue: [
- 			label := aStringOrTextOrMorph.
- 			r addMorph: aStringOrTextOrMorph]
- 		ifFalse: [
- 			label := aStringOrTextOrMorph asString.
- 			r addMorph: (StringMorph contents: label)].
- 	self addMorph: r.
- !

Item was changed:
  ----- Method: SystemProgressMorph>>freeSlot: (in category 'private') -----
  freeSlot: number
  	number > 0 ifTrue: [
  		lock critical: [
  			(bars at: number) delete.
  			(labels at: number) delete.
  			activeSlots := activeSlots - 1.
  			activeSlots = 0
  				ifTrue: [self delete]
  				ifFalse: [self recenter]]]!

Item was changed:




More information about the Squeak-dev mailing list