[squeak-dev] The Trunk: Graphics-ul.92.mcz
commits at source.squeak.org
commits at source.squeak.org
Sat Dec 12 14:22:10 UTC 2009
Levente Uzonyi uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-ul.92.mcz
==================== Summary ====================
Name: Graphics-ul.92
Author: ul
Time: 12 December 2009, 2:22:54 am
UUID: 158ef4d5-a801-2042-b8e3-f3bb97ffeff3
Ancestors: Graphics-ar.91
- replace sends of #ifNotNilDo: to #ifNotNil:, #ifNil:ifNotNilDo: to #ifNil:ifNotNil:, #ifNotNilDo:ifNil: to #ifNotNil:ifNil:
=============== Diff against Graphics-ar.91 ===============
Item was changed:
----- Method: TextStyle class>>replaceFontsIn:with: (in category 'mime file in/out') -----
replaceFontsIn: oldFontArray with: newStyle
"
TextStyle replaceFontsIn: (TextStyle looseFontsFromFamily: #Accuny) with: (TextStyle named: #Accuny)
"
"Try to find corresponding fonts in newStyle and substitute them for the fonts in oldFontArray"
newStyle fontArray do: [ :newFont | newFont releaseCachedState ].
oldFontArray do: [ :oldFont | | newFont |
oldFont reset.
newFont := (newStyle fontOfPointSize: oldFont pointSize) emphasis: oldFont emphasis.
oldFont becomeForward: newFont ].
StringMorph allSubInstancesDo: [ :s | s layoutChanged ].
TextMorph allSubInstancesDo: [ :s | s layoutChanged ].
SystemWindow allInstancesDo: [ :w | [ w update: #relabel ] on: Error do: [ :ex | ] ].
+ World ifNotNil: [ :w | w changed ].!
- World ifNotNilDo: [ :w | w changed ].!
Item was changed:
----- Method: TextStyle class>>fontMenuForStyle:target:selector:highlight: (in category 'user interface') -----
fontMenuForStyle: styleName target: target selector: selector highlight: currentFont
"Offer a font menu for the given style. If one is selected, pass
that font to target with a
call to selector. The fonts will be displayed in that font."
| aMenu displayFont |
aMenu := MenuMorph entitled: styleName.
(TextStyle named: styleName)
+ ifNotNil: [:s | s isTTCStyle
- ifNotNilDo: [:s | s isTTCStyle
ifTrue: [aMenu
add: 'New Size'
target: self
selector: #chooseTTCFontSize:
argument: {styleName. target. selector}]].
(self pointSizesFor: styleName)
do: [:pointSize |
| font subMenu |
font := (self named: styleName)
fontOfPointSize: pointSize.
subMenu := self
emphasisMenuForFont: font
target: target
selector: selector
highlight: (currentFont
+ ifNotNil: [:cf | (cf familyName = styleName
- ifNotNilDo: [:cf | (cf familyName = styleName
and: [cf pointSize = font pointSize])
ifTrue: [currentFont emphasis]]).
subMenu
ifNil: [aMenu
add: pointSize asString , ' Point'
target: target
selector: selector
argument: font]
ifNotNil: [aMenu add: pointSize asString , ' Point' subMenu: subMenu].
displayFont := font.
(font isSymbolFont or:[(font hasDistinctGlyphsForAll: pointSize asString , ' Point') not])
ifTrue:[
"don't use a symbol font to display its own name!!!!"
displayFont := self default fontOfPointSize: pointSize].
aMenu lastItem font: displayFont.
currentFont
+ ifNotNil: [:cf | (cf familyName = styleName
- ifNotNilDo: [:cf | (cf familyName = styleName
and: [cf pointSize = font pointSize])
ifTrue: [aMenu lastItem color: Color blue darker]]].
^ aMenu!
More information about the Squeak-dev
mailing list
|