<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">&lt;<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>&gt;</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: &#39;gradientDisplay rampMorphs selectedSketch row text target selector morph&#39;<br>
-       instanceVariableNames: &#39;gradientDisplay rampMorphs selectedSketch gradientMorph row text target selector morph&#39;<br>
        classVariableNames: &#39;&#39;<br>
        poolDictionaries: &#39;&#39;<br>
        category: &#39;Morphic-Widgets&#39;!<br>
<br>
Item was changed:<br>
  ----- Method: GradientEditor&gt;&gt;addButtonRow (in category &#39;initialization&#39;) -----<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&gt;&gt;initialize (in category &#39;initialization&#39;) -----<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>
+       &quot;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.&quot;<br>
-       self addMorph: text.<br>
        !<br>
<br>
Item was changed:<br>
  ----- Method: GradientEditor&gt;&gt;myLayout (in category &#39;initialization&#39;) -----<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&gt;&gt;updateColorRamp (in category &#39;change reporting&#39;) -----<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 -&gt; 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>
+       &quot;text setText: self colorRamp&quot;!<br>
-       text setText: self colorRamp!<br>
<br>
<br>
</blockquote></div><br></div>