[squeak-dev] The Trunk: ToolBuilder-Morphic-mt.305.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Mar 1 16:46:54 UTC 2022
Marcel Taeumel uploaded a new version of ToolBuilder-Morphic to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Morphic-mt.305.mcz
==================== Summary ====================
Name: ToolBuilder-Morphic-mt.305
Author: mt
Time: 1 March 2022, 5:46:53.070212 pm
UUID: df06fa81-ad88-4206-9a04-6a7e35391d92
Ancestors: ToolBuilder-Morphic-mt.304
Minor tweaks in text-field construction through tool builder regarding padding. Also, when drawing help texts in text fields, use the current text font, not UI property #balloonTextFont. I think we can remove that property of #PluggableTextMorphPlus from UI themes.
=============== Diff against ToolBuilder-Morphic-mt.304 ===============
Item was changed:
----- Method: MorphicToolBuilder>>buildPluggableText: (in category 'widgets required') -----
buildPluggableText: aSpec
| widget |
widget := self textPaneClass new.
aSpec stylerClass ifNotNil: [:c | widget styler: (c new view: widget)].
widget
on: aSpec model
text: aSpec getText
accept: aSpec setText
readSelection: aSpec selection
menu: aSpec menu.
aSpec textStyle
ifNotNil: [:ts |
ts isSymbol
ifTrue: [widget getTextStyleSelector: ts]
ifFalse: [widget setTextStyle: ts]]
ifNil: [
aSpec font ifNotNil: [:f |
f isSymbol
ifTrue: [widget getFontSelector: f]
ifFalse: [widget setTextStyle: f asNewTextStyle]] ].
widget readOnly: aSpec readOnly.
widget plainTextOnly: aSpec plainTextOnly.
widget editTextSelector: aSpec editText.
widget wantsFrameAdornments: aSpec indicateUnacceptedChanges.
widget askBeforeDiscardingEdits: aSpec askBeforeDiscardingEdits.
widget setProperty: #alwaysAccept toValue: aSpec askBeforeDiscardingEdits not.
widget wrapFlag: (aSpec softLineWrap ifNil: [true]).
self register: widget id: aSpec name.
widget getColorSelector: aSpec color.
widget getTextColorSelector: aSpec textColor.
self buildHelpFor: widget spec: aSpec.
self setFrame: aSpec frame in: widget.
+ self setLayoutHintsForTextField: widget spec: aSpec.
- self setLayoutHintsFor: widget spec: aSpec.
parent ifNotNil:[self add: widget to: parent].
^widget!
Item was added:
+ ----- Method: MorphicToolBuilder>>setLayoutHintsForTextField:spec: (in category 'private') -----
+ setLayoutHintsForTextField: widget spec: aSpec
+
+ aSpec minimumWidth >= 0
+ ifTrue: [widget minimumWidth: aSpec minimumWidth].
+ aSpec minimumHeight >= 0
+ ifTrue: [widget minimumHeight: aSpec minimumHeight].
+ aSpec padding
+ ifNotNil: [:p | widget textMorph margins: p].
+ "aSpec margin
+ ifNotNil: [:m | widget layoutOutset: m]."
+
+ widget hResizing: (aSpec horizontalResizing ifNil: [#spaceFill]).
+ widget vResizing: (aSpec verticalResizing ifNil: [#spaceFill]).!
Item was changed:
----- Method: PluggableTextMorphPlus>>drawBalloonTextOn: (in category 'drawing') -----
drawBalloonTextOn: aCanvas
"Show balloon text in the text morph if it has no contents. Catch errors to guard against broken models."
| helpText helpFont helpColor box |
textMorph contents ifNotEmpty: [ ^ self ].
helpText := [ self balloonText ] on: Error do: [ :err | '<error in #balloonText>' ].
helpText ifNil: [ ^ self ].
+ helpFont := self textMorph textStyle defaultFont.
+ "self userInterfaceTheme balloonTextFont ifNil: [TextStyle defaultFont]."
- helpFont := self userInterfaceTheme balloonTextFont ifNil: [TextStyle defaultFont].
helpColor := self userInterfaceTheme balloonTextColor ifNil: [Color gray: 0.7].
box := self innerBounds insetBy: (self textMorph margins ifNil: [0]).
box := box insetBy: (0 @ helpFont lineGapSlice corner: 0 at 0).
aCanvas drawString: helpText in: box font: helpFont color: helpColor.!
More information about the Squeak-dev
mailing list
|