@@ -49,6 +49,9 @@ public class CompareColorImpl implements RemovalListener<RGB, Color>, ICompareCo
49
49
50
50
/** Scale factor */
51
51
private static final double INTERPOLATION_SCALE_2 = 0.97 ;
52
+
53
+ /** Scale factor for filling of a selected element */
54
+ private static final double INTERPOLATION_SCALE_SELECTED_FILL = 0.3 ;
52
55
53
56
/** Scale factor to compute the color of border. */
54
57
private static final double DARKER_BORDER_SCALE_FACTOR = -0.5 ;
@@ -82,26 +85,32 @@ public class CompareColorImpl implements RemovalListener<RGB, Color>, ICompareCo
82
85
83
86
private RGB incomingFill ;
84
87
88
+ private RGB incommingSelectedFill ;
89
+
85
90
private RGB conflictSelected ;
86
91
87
92
private RGB conflict ;
88
93
89
94
private RGB conflictFill ;
90
95
96
+ private RGB conflictSelectedFill ;
97
+
91
98
private RGB outgoingSelected ;
92
99
93
100
private RGB outgoing ;
94
101
95
102
private RGB outgoingFill ;
96
103
104
+ private RGB outgoingSelectedFill ;
105
+
97
106
private RGB requiredColor ;
98
107
99
108
private RGB requiredBorderColor ;
100
109
101
110
private RGB unmergeableColor ;
102
111
103
112
private RGB unmergeableBorderColor ;
104
-
113
+
105
114
/**
106
115
* Constructor. With this constructor the colors will disposed at the same as the control.
107
116
*
@@ -153,29 +162,28 @@ public Color getFillColor(Diff diff, boolean isThreeWay, boolean isIgnoreAncesto
153
162
}
154
163
155
164
private RGB getFillRGB (Diff diff , boolean isThreeWay , boolean isIgnoreAncestor , boolean selected ) {
156
- RGB selectedFill = getBackground ();
157
165
if (isThreeWay && !isIgnoreAncestor ) {
158
166
boolean requiredConflictForWayOfMerge = false ;
159
167
160
168
if (diff .getConflict () == null && !requiredConflictForWayOfMerge ) {
161
169
switch (diff .getSource ()) {
162
170
case RIGHT :
163
171
if (fLeftIsLocal ) {
164
- return selected ? selectedFill : incomingFill ;
172
+ return selected ? incommingSelectedFill : incomingFill ;
165
173
}
166
- return selected ? selectedFill : outgoingFill ;
174
+ return selected ? outgoingSelectedFill : outgoingFill ;
167
175
case LEFT :
168
176
if (fLeftIsLocal ) {
169
- return selected ? selectedFill : outgoingFill ;
177
+ return selected ? outgoingSelectedFill : outgoingFill ;
170
178
}
171
- return selected ? selectedFill : incomingFill ;
179
+ return selected ? incommingSelectedFill : incomingFill ;
172
180
}
173
181
} else {
174
- return selected ? selectedFill : conflictFill ;
182
+ return selected ? conflictSelectedFill : conflictFill ;
175
183
}
176
- return selected ? selectedFill : conflictFill ;
184
+ return selected ? conflictSelectedFill : conflictFill ;
177
185
}
178
- return selected ? selectedFill : outgoingFill ;
186
+ return selected ? outgoingSelectedFill : outgoingFill ;
179
187
}
180
188
181
189
/**
@@ -234,20 +242,23 @@ protected final void updateColors() {
234
242
}
235
243
conflict = interpolate (conflictSelected , background , INTERPOLATION_SCALE_1 );
236
244
conflictFill = interpolate (conflictSelected , background , INTERPOLATION_SCALE_2 );
245
+ conflictSelectedFill = interpolate (conflictSelected , background , INTERPOLATION_SCALE_SELECTED_FILL );
237
246
238
247
outgoingSelected = fColorRegistry .getRGB (OUTGOING_CHANGE_COLOR_THEME_KEY );
239
248
if (outgoingSelected == null ) {
240
249
outgoingSelected = new RGB (0 , 0 , 0 ); // BLACK
241
250
}
242
251
outgoing = interpolate (outgoingSelected , background , INTERPOLATION_SCALE_1 );
243
252
outgoingFill = interpolate (outgoingSelected , background , INTERPOLATION_SCALE_2 );
253
+ outgoingSelectedFill = interpolate (outgoingSelected , background , INTERPOLATION_SCALE_SELECTED_FILL );
244
254
245
255
incomingSelected = fColorRegistry .getRGB (INCOMING_CHANGE_COLOR_THEME_KEY );
246
256
if (incomingSelected == null ) {
247
257
incomingSelected = new RGB (0 , 0 , MAX_RGB_COMPONENT ); // BLUE
248
258
}
249
259
incoming = interpolate (incomingSelected , background , INTERPOLATION_SCALE_1 );
250
260
incomingFill = interpolate (incomingSelected , background , INTERPOLATION_SCALE_2 );
261
+ incommingSelectedFill = interpolate (incomingSelected , background , INTERPOLATION_SCALE_SELECTED_FILL );
251
262
}
252
263
253
264
/**
0 commit comments