[squeak-dev] The Trunk: Tools-mt.723.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Aug 24 11:43:13 UTC 2016


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

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

Name: Tools-mt.723
Author: mt
Time: 24 August 2016, 1:42:52.759718 pm
UUID: c4e682b7-40df-cb44-935c-ff41fb24046f
Ancestors: Tools-mt.722

Simple MVC update to use UI theme colors for menus.

=============== Diff against Tools-mt.722 ===============

Item was changed:
  ----- Method: PopUpMenu>>computeForm (in category 'private') -----
  computeForm
  	"Compute and answer a Form to be displayed for this menu."
  
  	| borderInset paraForm menuForm inside |
  	borderInset := 4 at 4.
+ 	paraForm := ((DisplayText text: labelString asText textStyle: MenuStyle)
+ 		foregroundColor: (self userInterfaceTheme textColor ifNil: [Color black])
+ 		backgroundColor: (self userInterfaceTheme color ifNil: [Color white])) form.
- 	paraForm := (DisplayText text: labelString asText textStyle: MenuStyle) form.
  	menuForm := Form extent: paraForm extent + (borderInset * 2) depth: paraForm depth.
        menuForm fill: (0 @ 0 extent: menuForm  extent)
                          rule: Form over
+                         fillColor: (self userInterfaceTheme color ifNil: [Color white]).
+ 	menuForm
+ 		border: menuForm boundingBox
+ 		width: 2
+ 		fillColor: (self userInterfaceTheme borderColor ifNil: [Color black]).
+ 	
-                         fillColor: Color white.
- 	menuForm borderWidth: 2.
  	paraForm displayOn: menuForm at: borderInset.
  	lineArray == nil ifFalse:
  		[lineArray do:
  			[ :line |
+ 			menuForm
+ 				fill: (4 @ ((line * font height) + borderInset y)
+ 						extent: (menuForm width - 8 @ 1))
+ 				rule: Form over
+ 				fillColor: (self userInterfaceTheme lineColor ifNil: [Color black])]].
- 			menuForm fillBlack: (4 @ ((line * font height) + borderInset y)
- 				extent: (menuForm width - 8 @ 1))]].
  
  	frame := Quadrangle new.
  	frame region: menuForm boundingBox.
  	frame borderWidth: 4.
  	inside := frame inside.
  	marker := inside topLeft extent: (inside width @ MenuStyle lineGrid).
  	selection := 1.
  
  	^ form := menuForm
  !

Item was changed:
  ----- Method: PopUpMenu>>displayAt:withCaption:during: (in category 'displaying') -----
  displayAt: aPoint withCaption: captionOrNil during: aBlock
  	"Display the receiver just to the right of aPoint while aBlock is evaluated.  If the receiver is forced off screen, display it just to the right."
  	| delta savedArea captionForm captionSave outerFrame captionText tFrame frameSaveLoc captionBox |
  	marker ifNil: [self computeForm].
  	frame := frame align: marker leftCenter with: aPoint + (2 at 0).
  	outerFrame := frame.
  	captionOrNil notNil ifTrue:
  		[captionText := (DisplayText
  				text: captionOrNil asText
  				textStyle: MenuStyle copy centered)
+ 					foregroundColor: (self userInterfaceTheme textColor ifNil: [Color black])
+ 					backgroundColor: (self userInterfaceTheme color ifNil: [Color white]).
- 					foregroundColor: Color black
- 					backgroundColor: Color white.
  		tFrame := captionText boundingBox insetBy: -2.
  		outerFrame := frame merge: (tFrame align: tFrame bottomCenter
  					with: frame topCenter + (0 at 2))].
  	delta := outerFrame amountToTranslateWithin: Display boundingBox.
  	frame right > Display boundingBox right
  		ifTrue: [delta := 0 - frame width @ delta y].
  	frame := frame translateBy: delta.
  	captionOrNil notNil ifTrue:
  		[captionForm := captionText form.
  		captionBox := captionForm boundingBox expandBy: 4.
  		captionBox := captionBox align: captionBox bottomCenter
  								with: frame topCenter + (0 at 2).
  		captionSave := Form fromDisplay: captionBox.
+ 		Display border: captionBox width: 4 fillColor: (self userInterfaceTheme color ifNil: [Color white]).
+ 		Display border: captionBox width: 2 fillColor: (self userInterfaceTheme textColor ifNil: [Color black]).
- 		Display border: captionBox width: 4 fillColor: Color white.
- 		Display border: captionBox width: 2 fillColor: Color black.
  		captionForm displayAt: captionBox topLeft + 4].
  	marker := marker align: marker leftCenter with: aPoint + delta +  (2 at 0).
  	savedArea := Form fromDisplay: frame.
  	self menuForm displayOn: Display at: (frameSaveLoc := frame topLeft).
  	selection ~= 0 ifTrue: [Display reverse: marker].
  	Cursor normal showWhile: aBlock.
  	savedArea displayOn: Display at: frameSaveLoc.
  	captionOrNil notNil ifTrue:
  		[captionSave displayOn: Display at: captionBox topLeft]!



More information about the Squeak-dev mailing list