The Trunk: Morphic-kfr.929.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Morphic-kfr.929.mcz

commits-2
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@5; color: Color transparent). "padding"
- ""
  pair addMorphBack: aForm asMorph.
+ pair addMorphBack:  (Morph new extent: 5@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.
  !


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Morphic-kfr.929.mcz

Karl Ramberg
And I added a little padding around the menu title icon. 

Karl

On Sun, Apr 26, 2015 at 7:54 AM, <[hidden email]> 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@5; color: Color transparent). "padding"
-                       ""
                        pair addMorphBack: aForm asMorph.
+                       pair addMorphBack:  (Morph new extent: 5@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.
  !