[squeak-dev] The Trunk: ShoutCore-tpr.97.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Jan 16 02:11:22 UTC 2023
tim Rowledge uploaded a new version of ShoutCore to project The Trunk:
http://source.squeak.org/trunk/ShoutCore-tpr.97.mcz
==================== Summary ====================
Name: ShoutCore-tpr.97
Author: tpr
Time: 15 January 2023, 6:11:20.569396 pm
UUID: 21b242ac-5b00-4348-9717-959d8c82baec
Ancestors: ShoutCore-eem.96
Remove some variable shadowing
=============== Diff against ShoutCore-eem.96 ===============
Item was changed:
----- Method: SHTextStylerST80>>createTextAttributesForPixelHeight: (in category 'style table') -----
createTextAttributesForPixelHeight: aNumber
| result |
result := IdentityDictionary new.
result at: #default put: {}. "Required as fall-back for non-existing attributes."
self class themeProperties do: [:each |
+ | spec element emphasis newFont color |
- | spec element emphasis font color |
element := each first.
spec := self userInterfaceTheme perform: element.
spec isArray ifFalse: [spec := {spec}]. "Support color-only hints."
color := spec first ifNotNil: [:colorSpec | Color colorFrom: colorSpec].
emphasis := spec at: 2 ifAbsent:[nil].
+ newFont := spec at: 3 ifAbsent: [nil].
- font := spec at: 3 ifAbsent: [nil].
(element == #comment and: [self class enforceItalicEmphasisInComments])
ifTrue: [
emphasis
ifNil: [emphasis := TextEmphasis italic]
ifNotNil: [
emphasis isArray
ifFalse: [emphasis := {emphasis}, {TextEmphasis italic}]
ifTrue: [emphasis := emphasis, {TextEmphasis italic}].
emphasis := emphasis asSet asArray "no double italic"]].
"Support for named text styles."
+ newFont isString ifTrue: [
- font isString ifTrue: [
| textStyle |
+ textStyle := TextStyle named: newFont.
+ newFont := textStyle ifNotNil: [textStyle fontOfSize: aNumber]].
- textStyle := TextStyle named: font.
- font := textStyle ifNotNil: [textStyle fontOfSize: aNumber]].
+ (self createAttributeArrayForColor: color emphasis: emphasis font: newFont)
- (self createAttributeArrayForColor: color emphasis: emphasis font: font)
ifNotEmpty: [:attrArray | result at: element put: attrArray]].
^ result!
More information about the Squeak-dev
mailing list
|