[squeak-dev] The Trunk: Morphic-kfr.929.mcz
karl ramberg
karlramberg at gmail.com
Sun Apr 26 06:01:06 UTC 2015
And I added a little padding around the menu title icon.
Karl
On Sun, Apr 26, 2015 at 7:54 AM, <commits at source.squeak.org> wrote:
> Karl Ramberg uploaded a new version of Morphic to project The Trunk:
> http://source.squeak.org/trunk/Morphic-kfr.929.mcz
>
> ==================== Summary ====================
>
> Name: Morphic-kfr.929
> Author: kfr
> Time: 26 April 2015, 7:54:03.007 am
> UUID: 0835731c-0e6e-e640-99dd-fb130844d732
> Ancestors: Morphic-mt.928
>
> A few places still referenced Preferences menu colors. Fixed here
>
> =============== Diff against Morphic-mt.928 ===============
>
> Item was changed:
> ----- Method: MenuMorph>>addStayUpIcons (in category 'construction')
> -----
> addStayUpIcons
> | title closeBox pinBox titleBarArea titleString |
> title := submorphs
> detect: [:ea | ea hasProperty:
> #titleString]
> ifNone: [self setProperty:
> #needsTitlebarWidgets toValue: true.
> ^ self].
> closeBox := SystemWindowButton new target: self;
> actionSelector: #delete;
> labelGraphic: self class closeBoxImage;
> color: Color transparent;
> extent: self class closeBoxImage extent;
> borderWidth: 0.
> pinBox := SystemWindowButton new target: self;
> actionSelector: #stayUp:;
> arguments: {true};
> labelGraphic: self class pushPinImage;
> color: Color transparent;
> extent: self class pushPinImage extent;
> borderWidth: 0.
> Preferences noviceMode
> ifTrue: [closeBox setBalloonText: 'close this menu'.
> pinBox setBalloonText: 'keep this menu up'].
> titleBarArea := AlignmentMorph newRow vResizing: #shrinkWrap;
> layoutInset: 3;
> + color: MenuMorph menuTitleColor;
> - color: Preferences menuTitleColor;
> addMorphBack: closeBox;
> addMorphBack: title;
> addMorphBack: pinBox.
>
> title color: Color transparent.
>
> titleString := title
> findDeepSubmorphThat: [:each | each respondsTo: #font: ]
> ifAbsent: [StringMorph contents: String empty].
> titleString font: Preferences windowTitleFont.
> self wantsRoundedCorners
> ifTrue: [titleBarArea useRoundedCorners].
>
> self addMorphFront: titleBarArea.
> titleBarArea setProperty: #titleString toValue: (title
> valueOfProperty: #titleString).
> title removeProperty: #titleString.
> self setProperty: #hasTitlebarWidgets toValue: true.
> self removeProperty: #needsTitlebarWidgets.
> self removeStayUpItems!
>
> Item was changed:
> ----- Method: MenuMorph>>addTitle:icon:updatingSelector:updateTarget:
> (in category 'construction') -----
> addTitle: aString icon: aForm updatingSelector: aSelector updateTarget:
> aTarget
> "Add a title line at the top of this menu Make aString its initial
> contents.
> If aSelector is not nil, then periodically obtain fresh values for
> its
> contents by sending aSelector to aTarget.."
> | title titleContainer |
> title := AlignmentMorph newColumn.
> self setTitleParametersFor: title.
> ""
> aForm isNil
> ifTrue: [titleContainer := title]
> ifFalse: [| pair |
> pair := AlignmentMorph newRow.
>
> pair color: Color transparent.
> pair hResizing: #shrinkWrap.
> pair layoutInset: 0.
> + pair addMorphBack: (Morph new extent: 5 at 5;
> color: Color transparent). "padding"
> - ""
> pair addMorphBack: aForm asMorph.
> + pair addMorphBack: (Morph new extent: 5 at 5;
> color: Color transparent). "padding"
> - ""
> titleContainer := AlignmentMorph newColumn.
> titleContainer color: Color transparent.
> titleContainer vResizing: #shrinkWrap.
> titleContainer wrapCentering: #center.
> titleContainer cellPositioning: #topCenter.
> titleContainer layoutInset: 0.
> pair addMorphBack: titleContainer.
> ""
> title addMorphBack: pair].
> ""
> aSelector
> ifNil: [""
> aString asString
> linesDo: [:line | titleContainer
> addMorphBack: ((StringMorph
>
> contents: line
>
> font: Preferences standardMenuFont)
>
> color: (Color black);
>
> yourself)]]
> ifNotNil: [| usm |
> usm := UpdatingStringMorph on: aTarget selector:
> aSelector.
> usm font: Preferences standardMenuFont.
> usm useStringFormat.
> usm lock.
> titleContainer addMorphBack: usm].
> ""
> title setProperty: #titleString toValue: aString.
> self addMorphFront: title.
> ""
> title useSquareCorners.
> (self hasProperty: #needsTitlebarWidgets)
> ifTrue: [self addStayUpIcons]!
>
> Item was changed:
> ----- Method: MenuMorph>>setTitleParametersFor: (in category
> 'initialization') -----
> setTitleParametersFor: aMenuTitle
> | menuTitleColor menuTitleBorderColor |
> self wantsRoundedCorners
> ifTrue: [aMenuTitle useRoundedCorners].
>
> menuTitleColor := Preferences menuColorFromWorld
> ifTrue: [self color darker]
> + ifFalse: [MenuMorph menuTitleColor].
> - ifFalse: [Preferences menuTitleColor].
>
> menuTitleBorderColor := Preferences menuAppearance3d
> ifTrue: [#inset]
> ifFalse: [Preferences menuColorFromWorld
> ifTrue: [self color darker
> muchDarker]
> + ifFalse: [MenuMorph
> menuTitleBorderColor]].
> - ifFalse: [Preferences
> menuTitleBorderColor]].
>
> aMenuTitle
> setColor: menuTitleColor
> + borderWidth: MenuMorph menuTitleBorderWidth
> - borderWidth: Preferences menuTitleBorderWidth
> borderColor: menuTitleBorderColor;
> vResizing: #shrinkWrap;
> wrapCentering: #center;
> cellPositioning: #topCenter;
> layoutInset: 0.
> !
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20150426/eaa5d042/attachment.htm
More information about the Squeak-dev
mailing list
|