Skip to content

Commit fe147b4

Browse files
committed
🧰: only show delete tooltip for colorstop if more than two colorstops
1 parent 627e74a commit fe147b4

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

lively.ide/styling/color-stops.cp.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,26 @@ export class ColorStopControl extends Polygon {
1414
readOnly: true,
1515
get () { return true; }
1616
},
17+
tooltip: {
18+
derived: true,
19+
get () {
20+
return this.editor?.gradientValue?.stops.length > 2
21+
? 'Press ' + KeyHandler.prettyCombo('Delete') + ' to remove this color stop from the gradient.'
22+
: '';
23+
}
24+
},
1725
ui: {
1826
get () {
1927
return {
2028
transparent: this.getSubmorphNamed('transparent'),
2129
opaque: this.getSubmorphNamed('opaque')
2230
};
2331
}
32+
},
33+
expose: {
34+
get () {
35+
return ['tooltip'];
36+
}
2437
}
2538
};
2639
}
@@ -118,8 +131,7 @@ const ColorStop = component({
118131
const SelectedColorStop = component(ColorStop, {
119132
name: 'selected color stop',
120133
fill: Color.rgb(33, 150, 243),
121-
borderWidth: 0,
122-
tooltip: 'Press ' + KeyHandler.prettyCombo('Delete') + ' to remove this color stop from the gradient.'
134+
borderWidth: 0
123135
});
124136

125137
export { SelectedColorStop, ColorStop, ColorCell };

0 commit comments

Comments
 (0)