@@ -191,15 +191,13 @@ void ValidateQuotePaintCache(
191
191
const auto icon = st.icon .empty () ? nullptr : &st.icon ;
192
192
if (!cache.corners .isNull ()
193
193
&& cache.bgCached == cache.bg
194
- && cache.outline1Cached == cache.outline1
195
- && cache.outline2Cached == cache.outline2
194
+ && cache.outlines == cache.outlines
196
195
&& (!st.header || cache.headerCached == cache.header )
197
196
&& (!icon || cache.iconCached == cache.icon )) {
198
197
return ;
199
198
}
200
199
cache.bgCached = cache.bg ;
201
- cache.outline1Cached = cache.outline1 ;
202
- cache.outline2Cached = cache.outline2 ;
200
+ cache.outlinesCached = cache.outlines ;
203
201
if (st.header ) {
204
202
cache.headerCached = cache.header ;
205
203
}
@@ -220,25 +218,35 @@ void ValidateQuotePaintCache(
220
218
const auto full = QSize (side, side);
221
219
const auto ratio = style::DevicePixelRatio ();
222
220
223
- if (cache.outline1 == cache. outline2 ) {
221
+ if (! cache.outlines [ 1 ]. alpha () ) {
224
222
cache.outline = QImage ();
225
223
} else if (const auto outline = st.outline ) {
226
- const auto size = QSize (outline , outline * 6 );
224
+ const auto third = (cache.outlines [2 ].alpha () != 0 );
225
+ const auto size = QSize (outline , outline * (third ? 6 : 4 ));
227
226
cache.outline = QImage (
228
227
size * ratio,
229
228
QImage::Format_ARGB32_Premultiplied);
230
- cache.outline .fill (cache.outline1 );
229
+ cache.outline .fill (cache.outlines [ 0 ] );
231
230
cache.outline .setDevicePixelRatio (ratio);
232
231
auto p = QPainter (&cache.outline );
233
232
p.setCompositionMode (QPainter::CompositionMode_Source);
234
233
auto hq = PainterHighQualityEnabler (p);
235
234
auto path = QPainterPath ();
236
235
path.moveTo (outline , outline );
237
- path.lineTo (outline , outline * 4 );
238
- path.lineTo (0 , outline * 5 );
236
+ path.lineTo (outline , outline * (third ? 4 : 3 ) );
237
+ path.lineTo (0 , outline * (third ? 5 : 4 ) );
239
238
path.lineTo (0 , outline * 2 );
240
239
path.lineTo (outline , outline );
241
- p.fillPath (path, cache.outline2 );
240
+ p.fillPath (path, cache.outlines [1 ]);
241
+ if (third) {
242
+ auto path = QPainterPath ();
243
+ path.moveTo (outline , outline * 3 );
244
+ path.lineTo (outline , outline * 5 );
245
+ path.lineTo (0 , outline * 6 );
246
+ path.lineTo (0 , outline * 4 );
247
+ path.lineTo (outline , outline * 3 );
248
+ p.fillPath (path, cache.outlines [2 ]);
249
+ }
242
250
}
243
251
244
252
auto image = QImage (full * ratio, QImage::Format_ARGB32_Premultiplied);
@@ -260,7 +268,7 @@ void ValidateQuotePaintCache(
260
268
p.setClipRect (0 , 0 , outline , side);
261
269
p.drawRoundedRect (rect, radius, radius);
262
270
} else {
263
- p.setBrush (cache.outline1 );
271
+ p.setBrush (cache.outlines [ 0 ] );
264
272
p.setClipRect (0 , 0 , outline , side);
265
273
p.drawRoundedRect (rect, radius, radius);
266
274
}
@@ -408,7 +416,7 @@ void FillQuotePaint(
408
416
p.fillRect (0 , skipped, outline , height, cache.outline );
409
417
p.translate (-x, -top);
410
418
} else {
411
- p.fillRect (x, y, outline , height, cache.outline1 );
419
+ p.fillRect (x, y, outline , height, cache.outlines [ 0 ] );
412
420
}
413
421
}
414
422
p.fillRect (x + outline , y, width - outline , height, cache.bg );
0 commit comments