The Trunk: Morphic-ar.269.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-ar.269.mcz

commits-2
Andreas Raab uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ar.269.mcz

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

Name: Morphic-ar.269
Author: ar
Time: 16 December 2009, 2:20:11 am
UUID: 91567532-1a5a-0a4a-9093-21424db61fcc
Ancestors: Morphic-rss.268

Some tweaks for UserDialogBoxMorph:
- Default title for confirmation is now 'Please confirm:'.
- Title gradient is consistent with SystemWindow
- Title and buttons now use less agressive MC-ish blue tone

=============== Diff against Morphic-rss.268 ===============

Item was changed:
  ----- Method: UserDialogBoxMorph>>initialize (in category 'initialization') -----
  initialize
+ | titleRow titleFill cc |
- | titleRow titleFill |
  super initialize.
  self color: Color white.
  self listDirection: #topToBottom; wrapCentering: #center;
  hResizing: #shrinkWrap; vResizing: #shrinkWrap.
  self layoutInset: 0@0; cellInset: 5@5.
  self borderStyle: BorderStyle thinGray.
  self useRoundedCorners;
  addDropShadow;
  shadowColor: (TranslucentColor r: 0.0 g: 0.0 b: 0.0 alpha: 0.666);
  shadowOffset: 1 @ 1.
 
+ cc := Color gray: 0.8.
  titleRow := AlignmentMorph newRow.
  titleRow hResizing: #spaceFill; vResizing: #shrinkWrap.
+ titleRow layoutInset: 2@5.
+ titleRow color: cc.
+ titleFill := GradientFillStyle ramp: {0.0 -> Color white. 1 ->cc}.
- titleRow layoutInset: 2@2.
- titleRow color: Preferences menuTitleColor.
- titleFill := GradientFillStyle ramp: {0.0 -> Color white. 1 ->Preferences menuTitleColor}.
  titleFill radial: false; origin: titleRow topLeft; direction: 0 @ TextStyle defaultFont height.
  titleRow fillStyle: titleFill.
+ titleRow fillStyle: self titleGradient.
 
  titleMorph := StringMorph new.
  titleMorph emphasis: 1.
  titleRow addMorph: titleMorph.
  labelMorph := TextMorph new.
  labelMorph margins: 5@5.
  labelMorph lock.
  buttonRow := AlignmentMorph newRow vResizing: #shrinkWrap.
  buttonRow hResizing: #shrinkWrap; layoutInset: 5@5; cellInset: 5@5.
  buttonRow color: Color transparent.
  self addMorphBack: titleRow.
  self addMorphBack: labelMorph.
  self addMorphBack: buttonRow.
  self addDropShadow.!

Item was changed:
  ----- Method: UserDialogBoxMorph class>>confirm:orCancel:at: (in category 'utilities') -----
  confirm: aString orCancel: cancelBlock at: aPointOrNil
  "UserDialogBoxMorph confirm: 'Do you like chocolate?'"
  | dialog resp |
  dialog := self new.
+ dialog title: 'Please confirm:'.
- dialog title: 'Confirmation'.
  dialog label: aString.
  dialog addButton: '       Yes       ' translated value: true.
  dialog addButton: '        No        ' translated  value: false..
  dialog addButton: '     Cancel     ' translated  value: nil..
  resp := dialog runModalIn: ActiveWorld forHand: ActiveHand at: aPointOrNil.
  ^resp ifNil:[cancelBlock value]!

Item was changed:
  ----- Method: UserDialogBoxMorph>>addButton:value: (in category 'constructing') -----
  addButton: buttonLabel value: buttonValue
  "Adds a button with the given label and value.
  The value is returned if the user presses the button."
  | button |
  button := PluggableButtonMorphPlus new.
  button label: buttonLabel.
  button action:[self closeDialog: buttonValue].
+ button color: self buttonColor twiceLighter.
- button color: Preferences menuColor.
  buttonRow addMorphBack: button.
  !

Item was changed:
  ----- Method: UserDialogBoxMorph class>>confirm: (in category 'utilities') -----
  confirm: aString
  "UserDialogBoxMorph confirm: 'Do you like chocolate?'"
+ ^self confirm: aString title: 'Please confirm:'!
- ^self confirm: aString title: 'Confirm'!

Item was added:
+ ----- Method: UserDialogBoxMorph>>titleGradient (in category 'initialization') -----
+ titleGradient
+ | cc gradient |
+ cc :=  self buttonColor.
+ gradient := GradientFillStyle ramp: {
+ 0.0 -> Color white.
+ 0.33 ->(cc mixed: 0.5 with: Color white).
+ 1.0 -> cc.
+ }.
+ gradient origin: 0@0.
+ gradient direction: 0 @ (TextStyle defaultFont height + 10).
+ ^gradient!

Item was added:
+ ----- Method: UserDialogBoxMorph>>buttonColor (in category 'initialization') -----
+ buttonColor
+ ^Color r: 0.658 g: 0.678 b: 0.78!

Item was removed:
- ----- Method: UserDialogBoxMorph>>updateFill (in category 'running') -----
- updateFill
- | fill |
- fill := GradientFillStyle ramp: {0.0 -> Color white. 1 ->Preferences menuColor}.
- fill radial: false;
- origin: self topLeft;
- direction: 0 @ self height.
- self fillStyle: fill.
- !