[squeak-dev] The Trunk: ToolBuilder-Morphic-mt.302.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Feb 10 13:56:59 UTC 2022
Marcel Taeumel uploaded a new version of ToolBuilder-Morphic to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Morphic-mt.302.mcz
==================== Summary ====================
Name: ToolBuilder-Morphic-mt.302
Author: mt
Time: 10 February 2022, 2:56:58.523689 pm
UUID: 0e7eb88c-985d-5349-bdcb-a6d1ef493b2a
Ancestors: ToolBuilder-Morphic-mt.301
Speed up access to layout constants #buttonRowHeight, #inputFieldHeight, and #textFieldHeight.
Depends on Morphic-mt.1886.
=============== Diff against ToolBuilder-Morphic-mt.301 ===============
Item was changed:
ToolBuilder subclass: #MorphicToolBuilder
instanceVariableNames: 'widgets panes parentMenu'
+ classVariableNames: 'ButtonBorderWidth ListBorderWidth TextBorderWidth'
- classVariableNames: ''
poolDictionaries: ''
category: 'ToolBuilder-Morphic'!
!MorphicToolBuilder commentStamp: 'ar 2/11/2005 15:02' prior: 0!
The Morphic tool builder.!
Item was added:
+ ----- Method: MorphicToolBuilder class>>themeProperties (in category 'preferences') -----
+ themeProperties
+ "Let theme switches clear my cache. See #applyUserInterfaceTheme."
+
+ ^ {
+ { #textBorderWidth. 'tool construction'. ''}.
+ { #listBorderWidth. 'tool construction'. ''}.
+ { #buttonBorderWidth. 'tool construction'. ''}.
+ }!
Item was added:
+ ----- Method: MorphicToolBuilder>>applyUserInterfaceTheme (in category 'updating') -----
+ applyUserInterfaceTheme
+
+ TextBorderWidth := nil.
+ ListBorderWidth := nil.
+ ButtonBorderWidth := nil.!
Item was changed:
----- Method: MorphicToolBuilder>>buttonRowHeight (in category 'layout hints') -----
buttonRowHeight
| defaultMargins |
+ defaultMargins := PluggableButtonMorph labelMargins.
- defaultMargins := PluggableButtonMorph new layoutInset.
defaultMargins := defaultMargins ifNil: [0] ifNotNil: [:margins |
margins isRectangle
ifTrue: [margins top + margins bottom]
ifFalse: [margins isPoint
ifTrue: [margins y + margins y]
ifFalse: [margins + margins]]].
+ ButtonBorderWidth ifNil: [ButtonBorderWidth := (((UserInterfaceTheme current get: #borderWidth for: PluggableTextMorph) ifNil: [1]) * RealEstateAgent scaleFactor) truncated * 2].
+
^ (Preferences standardButtonFont lineGrid asFloat * 1.6) truncated "already includes the system's current #scaleFactor"
+ defaultMargins "already includes the system's current #scaleFactor"
+ + ButtonBorderWidth!
- + ((((UserInterfaceTheme current get: #borderWidth for: #PluggableButtonMorph) ifNil: [1]) * RealEstateAgent scaleFactor) truncated * 2)!
Item was added:
+ ----- Method: MorphicToolBuilder>>helpFieldHeightFor: (in category 'layout hints') -----
+ helpFieldHeightFor: numLines
+
+ ^ self textFieldHeightFor: numLines font: Preferences standardBalloonHelpFont!
Item was changed:
----- Method: MorphicToolBuilder>>inputFieldHeightFor: (in category 'layout hints') -----
inputFieldHeightFor: numLines
+ ^ self textFieldHeightFor: numLines font: TextStyle defaultFont!
- | defaultMargins |
- defaultMargins := TextMorph new margins.
- defaultMargins := defaultMargins ifNil: [0] ifNotNil: [:margins |
- margins isRectangle
- ifTrue: [margins top + margins bottom]
- ifFalse: [margins isPoint
- ifTrue: [margins y + margins y]
- ifFalse: [margins + margins]]].
-
- ^ (TextStyle defaultFont lineGrid * numLines) "already includes the system's current #scaleFactor"
- + defaultMargins "already includes the system's current #scaleFactor"
- + ((((UserInterfaceTheme current get: #borderWidth for: #PluggableTextMorph) ifNil: [1]) * RealEstateAgent scaleFactor) truncated * 2)!
Item was changed:
----- Method: MorphicToolBuilder>>listHeightFor: (in category 'layout hints') -----
listHeightFor: numLines
| defaultMargins |
+ defaultMargins := PluggableListMorph listMargins.
- defaultMargins := LazyListMorph new layoutInset.
defaultMargins := defaultMargins ifNil: [0] ifNotNil: [:margins |
margins isRectangle
ifTrue: [margins top + margins bottom]
ifFalse: [margins isPoint
ifTrue: [margins y + margins y]
ifFalse: [margins + margins]]].
+ ListBorderWidth ifNil: [ListBorderWidth := (((UserInterfaceTheme current get: #borderWidth for: PluggableTextMorph) ifNil: [1]) * RealEstateAgent scaleFactor) truncated * 2].
+
^ (Preferences standardListFont lineGridForMorphs * numLines) "already includes the system's current #scaleFactor"
+ defaultMargins "already includes the system's current #scaleFactor"
+ + ListBorderWidth!
- + ((((UserInterfaceTheme current get: #borderWidth for: #PluggableListMorph) ifNil: [1]) * RealEstateAgent scaleFactor) truncated * 2)!
Item was added:
+ ----- Method: MorphicToolBuilder>>textFieldHeightFor:font: (in category 'layout hints') -----
+ textFieldHeightFor: numLines font: font
+
+ | defaultMargins |
+ defaultMargins := PluggableTextMorph textMargins.
+ defaultMargins := defaultMargins ifNil: [0] ifNotNil: [:margins |
+ margins isRectangle
+ ifTrue: [margins top + margins bottom]
+ ifFalse: [margins isPoint
+ ifTrue: [margins y + margins y]
+ ifFalse: [margins + margins]]].
+
+ TextBorderWidth ifNil: [TextBorderWidth := (((UserInterfaceTheme current get: #borderWidth for: PluggableTextMorph) ifNil: [1]) * RealEstateAgent scaleFactor) truncated * 2].
+
+ ^ (font lineGrid * numLines) "already includes the system's current #scaleFactor"
+ + defaultMargins "already includes the system's current #scaleFactor"
+ + TextBorderWidth!
More information about the Squeak-dev
mailing list
|