The Trunk: Morphic-eem.1338.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-eem.1338.mcz

commits-2
Eliot Miranda uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-eem.1338.mcz

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

Name: Morphic-eem.1338
Author: eem
Time: 1 June 2017, 10:42:17.328212 am
UUID: 7676f50d-5b80-44bf-914a-c32d52382040
Ancestors: Morphic-pre.1337

Increase the visibility of the menu gradient by using thriceLighter to thriceDarker.
Add preferences to DialogWIndow to exclude the close button and/or control menu.

=============== Diff against Morphic-pre.1337 ===============

Item was changed:
  Morph subclass: #DialogWindow
  instanceVariableNames: 'titleMorph messageMorph paneMorph buttonRow result selectedButton cancelButton timeout preferredPosition keyMap exclusive filter filterEnabled filterMorph autoCancel'
+ classVariableNames: 'GradientDialog IncludeCloseButton IncludeControlMenu RoundedDialogCorners UseWiggleAnimation'
- classVariableNames: 'GradientDialog RoundedDialogCorners UseWiggleAnimation'
  poolDictionaries: ''
  category: 'Morphic-Windows'!
 
  !DialogWindow commentStamp: '<historical>' prior: 0!
  A DialogBoxMorph is Morph used in simple yes/no/confirm dialogs. Strongly modal.!

Item was added:
+ ----- Method: DialogWindow class>>includeCloseButton (in category 'preferences') -----
+ includeCloseButton
+
+ <preference: 'include dialog close button'
+ category: #dialogs
+ description: 'If true, user dialogs include a close button.'
+ type: #Boolean>
+ ^IncludeCloseButton ifNil: [true]!

Item was added:
+ ----- Method: DialogWindow class>>includeCloseButton: (in category 'preferences') -----
+ includeCloseButton: aBoolean
+
+ IncludeCloseButton := aBoolean!

Item was added:
+ ----- Method: DialogWindow class>>includeControlMenu (in category 'preferences') -----
+ includeControlMenu
+
+ <preference: 'include dialog control menu'
+ category: #dialogs
+ description: 'If true, user dialogs include a control menu.'
+ type: #Boolean>
+ ^IncludeControlMenu ifNil: [true]!

Item was added:
+ ----- Method: DialogWindow class>>includeControlMenu: (in category 'preferences') -----
+ includeControlMenu: aBoolean
+ IncludeControlMenu := aBoolean!

Item was changed:
  ----- Method: DialogWindow>>createTitle: (in category 'initialization') -----
  createTitle: aString
  "Mimick behavior of MenuMorph title creation."
 
  | box closeButton menuButton |
  box := Morph new
  name: #title;
  changeTableLayout;
  listDirection: #leftToRight;
  listCentering: #justified;
  yourself.
 
  titleMorph := aString asText asMorph lock.
 
  closeButton := SystemWindowButton new
  color: Color transparent;
  target: self;
  extent: 12@12;
  actionSelector: #cancelDialog;
  balloonText: 'Cancel this dialog' translated;
  borderWidth: 0;
  labelGraphic: SystemWindow closeBoxImage;
  extent: SystemWindow closeBoxImage extent;
+ visible: self class includeCloseButton;
  yourself.
 
  menuButton := SystemWindowButton new
  color: Color transparent;
  target: self;
  actionSelector: #offerDialogMenu;
  balloonText: 'Dialog menu' translated;
  borderWidth: 0;
  labelGraphic: SystemWindow menuBoxImage;
  extent: SystemWindow menuBoxImage extent;
+ visible: self class includeControlMenu;
  yourself.
 
  box addAllMorphs: {closeButton. titleMorph. menuButton}.
 
  self addMorphBack: box.
  self setTitleParameters.
  !

Item was changed:
  ----- Method: MenuItemMorph>>selectionFillStyle (in category 'private') -----
  selectionFillStyle
  " Answer the fill style to use with the receiver is the selected element "
 
  | fill baseColor |
  baseColor := self userInterfaceTheme selectionColor ifNil: [Color r: 0.4 g: 0.5 b: 0.7].
  MenuMorph gradientMenu ifFalse: [ ^baseColor ].
 
  fill := GradientFillStyle ramp: {
+ 0.0 -> baseColor thriceLighter.
+ 1 -> baseColor thriceDarker }.
- 0.0 -> baseColor twiceLighter.
- 1 -> baseColor twiceDarker }.
  fill origin: self topLeft.
  fill direction: 0 @ self height.
  ^ fill!

Item was added:
+ ----- Method: Morph class>>selectionBackground (in category 'defaults') -----
+ selectionBackground
+ "The background for selected items in lists and tree-list thingies."
+ ^ self subduedHilites ifTrue: [
+ Preferences textHighlightColor
+ ] ifFalse: [
+ "This is tuned so the red-foreground used for list texts stays somewhat legible."
+ Color r: 0.8 g:0.8 b: 0.81 alpha: 0.85
+ ].
+ !