<div dir="ltr">It should now be more feasible to remove some hard coded gradients in widgets like windows, buttons and menus.<div>Many of them rely on one user selected color and to hard code the other to white for example. </div><div>It should now be much easier to edit a gradient with more than 2 colors</div><div><br></div><div>Karl</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 29, 2015 at 1:10 PM, <span dir="ltr"><<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Karl Ramberg uploaded a new version of Morphic to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Morphic-kfr.1022.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/trunk/Morphic-kfr.1022.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Morphic-kfr.1022<br>
Author: kfr<br>
Time: 29 October 2015, 12:52:07.646 pm<br>
UUID: 64c8e8d1-462d-48e5-af29-706bd470f767<br>
Ancestors: Morphic-kfr.1021<br>
<br>
More look enhancements<br>
<br>
=============== Diff against Morphic-kfr.1021 ===============<br>
<br>
Item was changed:<br>
RectangleMorph subclass: #GradientEditor<br>
+ instanceVariableNames: 'gradientDisplay rampMorphs selectedSketch row text target selector morph'<br>
- instanceVariableNames: 'gradientDisplay rampMorphs selectedSketch gradientMorph row text target selector morph'<br>
classVariableNames: ''<br>
poolDictionaries: ''<br>
category: 'Morphic-Widgets'!<br>
<br>
Item was changed:<br>
----- Method: GradientEditor>>addButtonRow (in category 'initialization') -----<br>
addButtonRow<br>
| button button2 buttonRow button3 |<br>
buttonRow := RectangleMorph new borderWidth: 0;<br>
color: Color transparent;<br>
layoutPolicy: TableLayout new;<br>
+ hResizing: #spaceFil;<br>
+ vResizing: #spaceFill;<br>
- hResizing: #shrinkWrap;<br>
- vResizing: #shrinkWrap;<br>
cellPositioning: #center;<br>
listCentering: #topLeft;<br>
listDirection: #LeftToRight;<br>
reverseTableCells: true;<br>
+ cellInset: 4.<br>
- cellInset: 20 @ 20.<br>
<br>
button := PluggableButtonMorph on: self<br>
getState: nil<br>
action: #addHandle<br>
label: #addColorButtonLabel.<br>
+ button hResizing: #spaceFill;<br>
+ vResizing: #spaceFill.<br>
buttonRow addMorph: button.<br>
<br>
button2 := PluggableButtonMorph on: self<br>
getState: nil<br>
action: #deleteHandle<br>
label: #removeColorButtonLabel.<br>
+ button2 hResizing: #spaceFill;<br>
+ vResizing: #spaceFill.<br>
buttonRow addMorph: button2.<br>
<br>
button3 := PluggableButtonMorph on: self<br>
getState: nil<br>
action: #delete<br>
label: #closeButtonLabel.<br>
+ button3 hResizing: #spaceFill;<br>
+ vResizing: #spaceFill.<br>
buttonRow addMorph: button3.<br>
<br>
self addMorph: buttonRow!<br>
<br>
Item was changed:<br>
----- Method: GradientEditor>>initialize (in category 'initialization') -----<br>
initialize<br>
<br>
super initialize.<br>
self myLayout.<br>
self extent: 600 @ 150.<br>
row := RectangleMorph new extent: self width @ 100; color: Color transparent; borderColor: #inset.<br>
<br>
row addMorph: (gradientDisplay := GradientDisplayMorph new position: 20 @ 20;<br>
extent: self width - 40 @ 40).<br>
gradientDisplay fillStyle direction: gradientDisplay width @ 0.<br>
<br>
self addMorph: row.<br>
self addButtonRow.<br>
+ "text := PluggableTextMorph<br>
- text := PluggableTextMorph<br>
on: self<br>
text: #colorRamp<br>
accept: nil<br>
readSelection: nil<br>
menu: nil.<br>
text color: Color white;<br>
width: self width;<br>
height: 50.<br>
+ self addMorph: text."<br>
- self addMorph: text.<br>
!<br>
<br>
Item was changed:<br>
----- Method: GradientEditor>>myLayout (in category 'initialization') -----<br>
myLayout<br>
self color: (Color white darker) ;<br>
cornerStyle: #rounded ;<br>
borderWidth: 0;<br>
layoutPolicy: TableLayout new;<br>
hResizing: #shrinkWrap;<br>
vResizing: #shrinkWrap;<br>
cellPositioning: #center;<br>
listCentering: #topLeft;<br>
layoutInset: 4;<br>
listDirection: #topToBottom;<br>
reverseTableCells: true;<br>
wrapCentering: #topLeft;<br>
+ cellInset: 4!<br>
- cellInset: 19 @ 10!<br>
<br>
Item was changed:<br>
----- Method: GradientEditor>>updateColorRamp (in category 'change reporting') -----<br>
updateColorRamp<br>
| newAssociation newKey newColor sketch colorRamp |<br>
<br>
self updateRampMorphs.<br>
colorRamp := OrderedCollection new.<br>
rampMorphs<br>
do: [:i |<br>
newKey := ((i position x - gradientDisplay left / gradientDisplay width) asFloat roundUpTo: 0.01)<br>
min: 1.0<br>
max: 0.0.<br>
sketch := i findA: SketchMorph.<br>
newColor := sketch rotatedForm colorAt: sketch rotatedForm center.<br>
newAssociation := newKey -> newColor.<br>
colorRamp addLast: newAssociation].<br>
colorRamp := colorRamp sorted.<br>
gradientDisplay colorRamp: colorRamp.<br>
gradientDisplay fillStyle direction: gradientDisplay extent x @ 0.<br>
self changed.<br>
target ifNotNil:[<br>
target perform: selector<br>
with: colorRamp<br>
with: morph].<br>
+ "text setText: self colorRamp"!<br>
- text setText: self colorRamp!<br>
<br>
<br>
</blockquote></div><br></div>