The Trunk: Morphic-jcg.262.mcz

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

The Trunk: Morphic-jcg.262.mcz

commits-2
Joshua Gargus uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-jcg.262.mcz

==================== Summary ====================

Name: Morphic-jcg.262
Author: jcg
Time: 12 December 2009, 10:48:38 am
UUID: 762bff18-a758-408e-8cb6-ba4281c9587e
Ancestors: Morphic-dtl.261

Bulletproof #addStayUpIcons against not having a title.

=============== Diff against Morphic-dtl.261 ===============

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 := IconicButton new target: self;
  actionSelector: #delete;
  labelGraphic: self class closeBoxImage;
  color: Color transparent;
  extent: 14 @ 16;
  borderWidth: 0.
  pinBox := IconicButton new target: self;
  actionSelector: #stayUp:;
  arguments: {true};
  labelGraphic: self class pushPinImage;
  color: Color transparent;
  extent: 14 @ 15;
  borderWidth: 0.
  Preferences noviceMode
  ifTrue: [closeBox setBalloonText: 'close this menu'.
  pinBox setBalloonText: 'keep this menu up'].
  titleBarArea :=  AlignmentMorph newRow vResizing: #shrinkWrap;
  layoutInset: 3;
  color: Preferences menuTitleColor;
  addMorphBack: closeBox;
  addMorphBack: title;
  addMorphBack: pinBox.
 
  title color: Color transparent.
 
  titleString := title
  findDeepSubmorphThat: [:each | each respondsTo: #font: ]
  ifAbsent: [nil].
+ titleString ifNotNil: [titleString font: Preferences windowTitleFont].
- titleString font: Preferences windowTitleFont.
  Preferences roundedMenuCorners
  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!