Christoph Thiede uploaded a new version of ToolBuilder-Morphic to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Morphic-ct.342.mcz
==================== Summary ====================
Name: ToolBuilder-Morphic-ct.342
Author: ct
Time: 20 May 2023, 8:36:35.416721 pm
UUID: fe89f5d8-869f-854f-8b5d-7f897ac1cb54
Ancestors: ToolBuilder-Morphic-mt.341
Proposal: When opening them as tools, also attach regular morphs to the cursor depending on #openToolsAttachedToMouseCursor. Thus, opening non-window tools using the mouse feels more natural when the preference is enabled. For instance, TextMessageLink would benefit from this.
"SketchMorph extraExampleCook openAsTool"
=============== Diff against ToolBuilder-Morphic-mt.341 ===============
Item was changed:
----- Method: Morph>>openAsTool (in category '*ToolBuilder-Morphic-opening') -----
openAsTool
+ "Open this morph as a tool, that is, honor the preference #openToolsAttachedToMouseCursor."
+ self openInWorld.
+ (Project uiManager openToolsAttachedToMouseCursor
+ and: [ | event |
+ event := self currentEvent.
+ event isMouse and: [event isMouseUp]])
+ ifTrue: [
+ self currentHand attachMorph: self].!
- self openInWorld.!
Christoph Thiede uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-ct.541.mcz
==================== Summary ====================
Name: Graphics-ct.541
Author: ct
Time: 1 June 2023, 9:07:27.980127 pm
UUID: ee2eb548-c686-9a4f-b85c-3dd027cf9d8f
Ancestors: Graphics-nice.540
Merges Color-fromString-css-function-1.cs:
Adds support for basic CSS color functions to Color fromString:. This may be especially helpful for parsing HTML. While there are other color functions in CSS such as hsv(), lch(), oklab(), et al. for color models that we don't support, and CSS colors may be complex expressions, simple rgb() and argb() expressions are especially common.
Revision:
Moved private constructors into private category. Fixed plenk.
=============== Diff against Graphics-nice.540 ===============
Item was changed:
+ ----- Method: Color class>>fromHTMLString: (in category 'instance creation - private') -----
- ----- Method: Color class>>fromHTMLString: (in category 'other') -----
fromHTMLString: aColorHex
"Do not call this method directly, call Color>>#fromString: instead as it is more generic"
| green red blue resultColor |
red := (Integer readFrom: (aColorHex first: 2) base: 16).
green := (Integer readFrom: (aColorHex copyFrom: 3 to: 4) base: 16).
blue := (Integer readFrom: (aColorHex copyFrom: 5 to: 6) base: 16).
resultColor := self r: red g: green b: blue range: 255.
^ (aColorHex size = 8)
ifTrue: [resultColor alpha: ((Integer readFrom: (aColorHex last: 2) base: 16) / 255)]
ifFalse: [resultColor]!
Item was added:
+ ----- Method: Color class>>fromRGBAString: (in category 'instance creation - private') -----
+ fromRGBAString: rgba
+ "Do not call this method directly, call Color>>#fromString: instead as it is more generic"
+
+ | alpha |
+ alpha := (Float readFrom: (rgba at: 4)) min: 1 max: 0.
+ ^ (self fromRGBString: rgba)
+ alpha: alpha!
Item was changed:
+ ----- Method: Color class>>fromRGBString: (in category 'instance creation - private') -----
- ----- Method: Color class>>fromRGBString: (in category 'other') -----
fromRGBString: rgb
"Do not call this method directly, call Color>>#fromString: instead as it is more generic"
| green red blue |
red := (Integer readFrom:(rgb at: 1)) min: 255 max: 0.
green := (Integer readFrom:(rgb at: 2)) min: 255 max: 0.
blue := (Integer readFrom:(rgb at: 3)) min: 255 max: 0.
^self r: red g: green b: blue range: 255!
Item was changed:
----- Method: Color class>>fromString: (in category 'instance creation') -----
fromString: aString
"for HTML color spec: #FFCCAA or white/black/red/other name, or an r,g,b triplet string"
"Color fromString: '#FFCCAA'.
Color fromString: 'white'.
Color fromString: 'orange'
Color fromString: '126,42,33' "
| aColorHex rgb|
aString isEmptyOrNil ifTrue: [ ^self white ].
aString first = $#
ifTrue: [ aColorHex := aString allButFirst ]
ifFalse: [ aColorHex := aString ].
"is the string a 6 digit hex number?"
((aColorHex size = 6 or: [aColorHex size = 8]) and: [
aColorHex allSatisfy: [ :each | '0123456789ABCDEFabcdef' includes: each ] ])
ifTrue: [^ self fromHTMLString: aColorHex ].
+ "is the string a CSS function?"
+ aString last = $) ifTrue: [
+ "While there are other color functions in CSS such as hsv(), lch(), oklab(), et al. for color models that we don't support, and CSS colors may be complex expressions, simple rgb() and argb() expressions are especially common."
+ (aString beginsWith: 'rgb(') ifTrue: [
+ rgb := ((aString allButLast allButFirst: 4) findTokens: $,) collect: #withBlanksTrimmed.
+ ^ self fromRGBString: rgb].
+ (aString beginsWith: 'rgba(') ifTrue: [
+ | rgba |
+ rgba := ((aString allButLast allButFirst: 5) findTokens: $,) collect: #withBlanksTrimmed.
+ ^ self fromRGBAString: rgba].
+ self flag: #forLater. "support hsl and hsla"
+ ^ self white].
+
"is the string in the form a,b,c ?"
rgb := aColorHex findTokens: $, .
rgb size = 3 ifTrue: [^ self fromRGBString: rgb].
"try to match aColorHex with known named colors, case insensitive"
^self perform: (ColorNames detect: [:colorSymbol | aColorHex sameAs: colorSymbol] ifNone: [ #white ])!
Item was changed:
+ ----- Method: Color class>>shutDown (in category 'class initialization') -----
- ----- Method: Color class>>shutDown (in category 'other') -----
shutDown
"Color shutDown"
ColorChart := nil. "Palette of colors for the user to pick from"
CachedColormaps := nil. "Maps to translate between color depths"
MaskingMap := nil. "Maps all colors except transparent to black for creating a mask"
!
Christoph Thiede uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-ct.1209.mcz
==================== Summary ====================
Name: Tools-ct.1209
Author: ct
Time: 1 June 2023, 6:28:28.483263 pm
UUID: eeae5d94-3e79-334c-af43-277dfd9ae0ed
Ancestors: Tools-mt.1208
Fixes "Project findAFolder..." in MVC by adding missing override (cf. #open). We still need to discuss how we want to move on with PluggableFileList. See: https://lists.squeakfoundation.org/archives/list/squeak-dev@lists.squeakfou…
=============== Diff against Tools-mt.1208 ===============
Item was added:
+ ----- Method: PluggableFileList>>openLabel: (in category 'initialize-release') -----
+ openLabel: aString
+ self deprecated: 'PluggableFileList is being deprecated'. "This can go away soon"
+
+ ^ Project uiManager openPluggableFileList: self label: aString in: self currentWorld!