The Trunk: Morphic-mt.2227.mcz
[email protected] Fri, 31 Jul 2026 08:44:58 0000
| Newsgroups | gmane.comp.lang.smalltalk.squeak.general |
|---|---|
| Message-ID | <[email protected]> |
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.2227.mcz
==================== Summary ====================
Name: Morphic-mt.2227
Author: mt
Time: 31 July 2026, 10:44:56.728032 am
UUID: 7c283b01-c0ca-de44-84cf-56026886ba4b
Ancestors: Morphic-ct.2226, Morphic-ct.2224
In preparation of the release (and some fixes to the Objectland starter), merges Morphic-ct.2226, Morphic-ct.2224.
(Note that this is kind of a higher-risk change to SystemWindow, which is a central thing in our system. Usually, this is not okay within the Code-Freeze, still, we are trying to let the Objectland shine at least during first image start-up. Let's hope it is worth it. :-)
=============== Diff against Morphic-ct.2223 ===============
Item was changed:
----- Method: MenuItemMorph>>applyUserInterfaceTheme (in category 'updating') -----
applyUserInterfaceTheme
super applyUserInterfaceTheme.
self
color: (self userInterfaceTheme textColor ifNil: [Color black]);
font: (self userInterfaceTheme font ifNil: [TextStyle defaultFont]).
+ self icon ifNotNil: [self icon: self icon scaleIconToDisplay] "forth and back will be blurry, though".
+ self submorphs
+ detect: [:m | m isImageMorph]
+ ifFound: [:marker |
+ marker image: marker image scaleIconToDisplay.
+ marker position: self left @ (self top + 2 px)].!
- !
Item was changed:
----- Method: MenuItemMorph>>contents:withMarkers:inverse: (in category 'accessing') -----
contents: aString withMarkers: aBool inverse: inverse
"Set the menu item entry. If aBool is true, parse aString for embedded markers."
| markerIndex marker |
self contentString: nil. "get rid of old"
aBool ifFalse: [^super contents: aString].
self removeAllMorphs. "get rid of old markers if updating"
self hasIcon ifTrue: [ self icon: nil ].
(aString notEmpty and: [aString first = $<])
ifFalse: [^super contents: aString].
markerIndex := aString indexOf: $>.
markerIndex = 0 ifTrue: [^super contents: aString].
marker := (aString copyFrom: 1 to: markerIndex) asLowercase.
(#('<on>' '<off>' '<yes>' '<no>') includes: marker)
ifFalse: [^super contents: aString].
self contentString: aString. "remember actual string"
marker := (marker = '<on>' or: [marker = '<yes>']) ~= inverse
ifTrue: [self onImage]
ifFalse: [self offImage].
super contents: (aString copyFrom: markerIndex + 1 to: aString size).
"And set the marker"
marker := ImageMorph new image: marker scaleIconToDisplay.
+ marker position: self left @ (self top + 2 px).
- marker position: self left @ (self top + 2).
self addMorphFront: marker!
Item was changed:
----- Method: MenuMorph>>applyUserInterfaceTheme (in category 'update') -----
applyUserInterfaceTheme
| colorToUse |
super applyUserInterfaceTheme.
self setDefaultParameters.
+ self submorphs
+ detect: [:ea | ea hasProperty: #titleString]
+ ifFound: [:title |
+ title firstSubmorph "closeBox" delete.
+ self removeStayUpBox; addStayUpIcons.
+ self stayUp ifTrue: [self removeStayUpBox].
+
+ (title findDeeplyA: StringMorph) ifNotNil: [:label | | fontToUse |
+ fontToUse := self userInterfaceTheme titleFont ifNil: [TextStyle defaultFont].
+ colorToUse := self userInterfaceTheme titleTextColor ifNil: [Color black].
+ label font: fontToUse; color: colorToUse]].
+
"Update properties of separating lines."
colorToUse := self userInterfaceTheme lineColor ifNil: [Color gray: 0.9].
self submorphs
select: [:ea | ea knownName = #line]
thenDo: [:line |
line
color: colorToUse;
+ height: (self userInterfaceTheme lineWidth ifNil: [2]) px;
- height: (self userInterfaceTheme lineWidth ifNil: [2]);
borderStyle: (self userInterfaceTheme lineStyle ifNil: [BorderStyle inset]) copy;
+ borderColor: colorToUse;
+ borderWidth: 1 px].!
- borderColor: colorToUse].!
Item was changed:
----- Method: MenuMorph>>positionAt:relativeTo:inWorld: (in category 'private') -----
positionAt: aPoint relativeTo: aMenuItem inWorld: aWorld
"Note: items may not be laid out yet (I found them all to be at 0@0),
so we have to add up heights of items above the selected item."
| i yOffset sub delta |
self fullBounds. "force layout"
i := 0.
yOffset := 0.
[(sub := self submorphs at: (i := i + 1)) == aMenuItem]
whileFalse: [yOffset := yOffset + sub height].
+ self position: aPoint - (2 px @ (yOffset + 8 px)).
- self position: aPoint - (2 @ (yOffset + 8)).
"If it doesn't fit, show it to the left, not to the right of the hand."
self right > aWorld worldBounds right
ifTrue:
+ [self right: aPoint x + 1 px].
- [self right: aPoint x + 1].
"Make sure that the menu fits in the world."
delta := self bounds amountToTranslateWithin:
+ (aWorld worldBounds withHeight: ((aWorld worldBounds height - 18 px) max: (self currentHand position y) + 1 px)).
- (aWorld worldBounds withHeight: ((aWorld worldBounds height - 18) max: (self currentHand position y) + 1)).
delta isZero ifFalse: [self position: self position + delta].!
Item was changed:
----- Method: MenuMorph>>removeStayUpBox (in category 'menu') -----
removeStayUpBox
| box |
submorphs isEmpty ifTrue: [^self].
(submorphs first isAlignmentMorph) ifFalse: [^self].
box := submorphs first submorphs last.
(box isKindOf: IconicButton)
ifTrue:
[box
+ lock;
+ labelGraphic: ((Form extent: box extent depth: 8) fillWithColor: Color transparent);
- labelGraphic: (Form extent: box extent depth: 8);
shedSelvedge;
+ borderWidth: 0]!
- borderWidth: 0;
- lock]!
Item was changed:
----- Method: MenuMorph>>setTitleParametersFor: (in category 'initialization') -----
setTitleParametersFor: aMenuTitle
aMenuTitle
color: (self userInterfaceTheme titleColor ifNil: [Color transparent]);
borderStyle: (self userInterfaceTheme titleBorderStyle ifNil: [BorderStyle simple]) copy;
borderColor: (self userInterfaceTheme titleBorderColor ifNil: [Color r: 0.6 g: 0.7 b: 1]);
+ borderWidth: (self userInterfaceTheme titleBorderWidth ifNil: [0]) px;
- borderWidth: (self userInterfaceTheme titleBorderWidth ifNil: [0]);
cornerStyle: (self wantsRoundedCorners ifTrue: [#rounded] ifFalse: [#square]);
vResizing: #shrinkWrap;
wrapCentering: #center;
cellPositioning: #center;
+ cellGap: 5 px;
+ layoutInset: (5 px @ 0 corner: 5 px @ 0).!
- cellGap: 5;
- layoutInset: (5@0 corner: 5@0).!
Item was changed:
----- Method: SystemWindow>>applyUserInterfaceTheme (in category 'user interface') -----
applyUserInterfaceTheme
super applyUserInterfaceTheme.
+ self setDefaultParameters.
+ labelArea ifNotNil: [self replaceBoxes].
+ self refreshWindowColor.
- self
- setDefaultParameters;
- replaceBoxes;
- refreshWindowColor.
self isLookingFocused
ifTrue: [self lookUnfocused; lookFocused]
ifFalse: [self lookFocused; lookUnfocused].
self isCollapsed ifTrue: [self setProperty: #applyTheme toValue: true].!
Item was changed:
----- Method: SystemWindow>>boxExtent (in category 'initialization') -----
boxExtent
"the label height is used to be proportional to the fonts preferences"
+ | boxExtent |
+ boxExtent := self class boxExtent.
+ label ifNil: [^ boxExtent].
+ ^ boxExtent max: label height @ label height !
- ^ self class boxExtent
- max: label height @ label height !
Item was changed:
----- Method: SystemWindow>>displayScaleChangedBy: (in category 'layout') -----
displayScaleChangedBy: factor
"Overwritten to also update the label area and reset the #cellGap (and #splitters)."
super displayScaleChangedBy: factor.
self cellGap: ProportionalSplitterMorph gripThickness.
+ self wantsGrips ifTrue: [
+ self layoutInset: ProportionalSplitterMorph gripThickness].
- self layoutInset: ProportionalSplitterMorph gripThickness.
self setFramesForLabelArea.
"self replaceBoxes."!
Item was changed:
----- Method: SystemWindow>>initialize (in category 'initialization') -----
initialize
"Initialize a system window. Add label, stripes, etc., if desired"
super initialize.
allowReframeHandles := true.
isCollapsed := false.
paneMorphs := Array new.
mustNotClose := false.
updatablePanes := Array new.
self layoutPolicy: ProportionalLayout new.
self wantsPaneSplitters: true.
self wantsGrips: true.
- self layoutInset: ProportionalSplitterMorph gripThickness.
self cellGap: ProportionalSplitterMorph gripThickness.
self initializeLabelArea.
self addGrips.
self setDefaultParameters.
self initializeKeyboardShortcuts.!
Item was added:
+ ----- Method: SystemWindow>>removeLabelArea (in category 'initialization') -----
+ removeLabelArea
+
+ labelArea ifNil: [^ self].
+
+ labelArea abandon.
+ labelArea := nil.
+ label abandon.
+ label := nil.
+ closeBox := collapseBox := menuBox := expandBox := nil.
+ stripes := nil.!
Item was changed:
----- Method: SystemWindow>>replaceBoxes (in category 'initialization') -----
replaceBoxes
"Rebuild the various boxes."
+ labelArea ifNotNil: [self setLabelWidgetAllowance].
- self setLabelWidgetAllowance.
label ifNotNil: [label delete].
labelArea ifNotNil: [labelArea delete].
self initializeLabelArea.
self setFramesForLabelArea.
self setWindowColor: self paneColor.
self isActive
ifTrue: [self passivate; activate]
ifFalse: [self activate; passivate].!
Item was changed:
----- Method: SystemWindow>>setDefaultParameters (in category 'initialization') -----
setDefaultParameters
Preferences menuAppearance3d
ifFalse: [self hasDropShadow: false]
ifTrue: [
self addDropShadow.
self hasDropShadow: self isKeyWindow. "maybe turn off again"].
self borderWidth: (self userInterfaceTheme borderWidth ifNil: [1]) px.
+ label ifNotNil: [
+ label font: (self userInterfaceTheme titleFont ifNil: [TextStyle defaultFont])].!
- label font: (self userInterfaceTheme titleFont ifNil: [TextStyle defaultFont]).!
Item was added:
+ ----- Method: SystemWindow>>wantsGrips: (in category 'resize/collapse') -----
+ wantsGrips: aBoolean
+
+ super wantsGrips: aBoolean.
+
+ self layoutInset: (aBoolean
+ ifTrue: [ProportionalSplitterMorph gripThickness]
+ ifFalse: [0]).!
Squeak-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]