The Trunk: Morphic-kfr.1021.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-kfr.1021.mcz

commits-2
Karl Ramberg uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-kfr.1021.mcz

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

Name: Morphic-kfr.1021
Author: kfr
Time: 28 October 2015, 6:07:53.098 pm
UUID: 6ece13c6-b1e4-4cd1-a039-1d57ba351644
Ancestors: Morphic-kfr.1020

Adopted look more like NewColorPicker

=============== Diff against Morphic-kfr.1020 ===============

Item was changed:
  ----- Method: GradientEditor>>addButtonRow (in category 'initialization') -----
  addButtonRow
+ | button button2 buttonRow button3 |
+ buttonRow := RectangleMorph new borderWidth: 0;
+ color: Color transparent;
+ layoutPolicy: TableLayout new;
+ hResizing: #shrinkWrap;
+ vResizing: #shrinkWrap;
- | button button2 buttonRow button4 |
- buttonRow := RectangleMorph new extent: self width @ 30;
- borderWidth: 0; color: Color transparent.
- buttonRow layoutPolicy: TableLayout new;
  cellPositioning: #center;
  listCentering: #topLeft;
  listDirection: #LeftToRight;
  reverseTableCells: true;
  cellInset: 20 @ 20.
 
+ button := PluggableButtonMorph on: self
+ getState: nil
+ action: #addHandle
+ label: #addColorButtonLabel.
- button := SimpleButtonMorph new target: self;
- label: 'Add color';
- actionSelector: #addHandle.
  buttonRow  addMorph: button.
 
+ button2 := PluggableButtonMorph on: self
+ getState: nil
+ action: #deleteHandle
+ label: #removeColorButtonLabel.
- button2 := SimpleButtonMorph new target: self;
- label: 'Remove color';
- actionSelector: #deleteHandle.
  buttonRow addMorph: button2.
 
+ button3 := PluggableButtonMorph on: self
+ getState: nil
+ action: #delete
+ label: #closeButtonLabel.
+ buttonRow addMorph: button3.
- button4 := SimpleButtonMorph new target: self;
- label: 'Close';
- actionSelector: #delete.
- buttonRow addMorph: button4.
 
  self addMorph: buttonRow!

Item was added:
+ ----- Method: GradientEditor>>addColorButtonLabel (in category 'initialization') -----
+ addColorButtonLabel
+ ^ 'Add color' translated!

Item was added:
+ ----- Method: GradientEditor>>closeButtonLabel (in category 'initialization') -----
+ closeButtonLabel
+ ^ 'Close' translated!

Item was changed:
  ----- Method: GradientEditor>>deleteHandle (in category 'change reporting') -----
  deleteHandle
+ rampMorphs do:[ :i | (i color == Color black) ifTrue:[ rampMorphs remove: i. row removeMorph: i]].
- rampMorphs do:[ :i | (i color == Color red) ifTrue:[ rampMorphs remove: i. row removeMorph: i]].
  self updateColorRamp
 
  !

Item was changed:
  ----- Method: GradientEditor>>handle (in category 'initialization') -----
  handle
   | handle |
  handle := PolygonMorph
  vertices: (Array
  with: 0 @ 0
  with: 16 @ 0
  with: 8 @ 16)
+ color: (Color white darker)
- color: Color gray
  borderWidth: 1
  borderColor: Color black.
  ^handle
  addMorph: ((RectangleMorph
  newBounds: (8 @ 18 extent: 1 @ (gradientDisplay height - 2))
  color: Color orange)
  borderWidth: 0).!

Item was changed:
  ----- Method: GradientEditor>>initialize (in category 'initialization') -----
  initialize
 
  super initialize.
  self myLayout.
  self extent: 600 @ 150.
+ row := RectangleMorph new extent: self width @ 100; color: Color transparent; borderColor: #inset.
- row := RectangleMorph new extent: self width @ 100.
 
  row addMorph: (gradientDisplay := GradientDisplayMorph new position: 20 @ 20;
  extent: self width - 40 @ 40).
  gradientDisplay fillStyle direction: gradientDisplay width @ 0.
+
- "self addHandles."
  self addMorph: row.
  self addButtonRow.
  text := PluggableTextMorph
  on: self
  text: #colorRamp
  accept: nil
  readSelection: nil
  menu: nil.
  text color: Color white;
  width: self width;
  height: 50.
  self addMorph: text.
  !

Item was changed:
  ----- Method: GradientEditor>>limitHandleMove:event:from: (in category 'change reporting') -----
  limitHandleMove: association event: evt from: handle
  | p  newBounds |
+ rampMorphs do:[ : i | i color: (Color white darker)].
- rampMorphs do:[ : i | i color: Color gray].
  newBounds := gradientDisplay bounds.
  newBounds := (newBounds left: (newBounds left - 10)).
  newBounds := (newBounds right: (newBounds right - 10)).
+ p := (evt cursorPoint - (10@0)) adhereTo: newBounds.
- p := evt cursorPoint adhereTo: newBounds.
  handle position: (p x )@ (handle position y).
+ handle color: Color black.
- handle color: Color red.
  self updateColorRamp!

Item was changed:
  ----- Method: GradientEditor>>myLayout (in category 'initialization') -----
  myLayout
+ self color: (Color white darker) ;
+ cornerStyle: #rounded ;
+ borderWidth: 0;
+ layoutPolicy: TableLayout new;
- self layoutPolicy: TableLayout new;
  hResizing: #shrinkWrap;
  vResizing: #shrinkWrap;
  cellPositioning: #center;
  listCentering: #topLeft;
+ layoutInset: 4;
- layoutInset: 10@10;
  listDirection: #topToBottom;
  reverseTableCells: true;
  wrapCentering: #topLeft;
  cellInset: 19 @ 10!

Item was added:
+ ----- Method: GradientEditor>>removeColorButtonLabel (in category 'initialization') -----
+ removeColorButtonLabel
+ ^ 'Remove color' translated!