Fix service message highlighting.

This commit is contained in:
John Preston 2017-03-07 20:54:30 +03:00
parent 81790b2271
commit a441a9fca9
1 changed files with 8 additions and 4 deletions

View File

@ -193,12 +193,16 @@ void ServiceMessagePainter::paint(Painter &p, const HistoryService *message, con
if (animms > st::activeFadeInDuration + st::activeFadeOutDuration) {
App::main()->stopAnimActive();
} else {
int skiph = st::msgServiceMargin.top() - st::msgServiceMargin.bottom();
auto top = st::msgServiceMargin.top();
auto bottom = st::msgServiceMargin.bottom();
auto fill = qMin(top, bottom);
auto skiptop = top - fill;
auto fillheight = fill + height + fill;
float64 dt = (animms > st::activeFadeInDuration) ? (1 - (animms - st::activeFadeInDuration) / float64(st::activeFadeOutDuration)) : (animms / float64(st::activeFadeInDuration));
float64 o = p.opacity();
auto dt = (animms > st::activeFadeInDuration) ? (1. - (animms - st::activeFadeInDuration) / float64(st::activeFadeOutDuration)) : (animms / float64(st::activeFadeInDuration));
auto o = p.opacity();
p.setOpacity(o * dt);
p.fillRect(0, skiph, message->history()->width, message->height() - skiph, st::defaultTextPalette.selectOverlay);
p.fillRect(0, skiptop, message->history()->width, fillheight, st::defaultTextPalette.selectOverlay);
p.setOpacity(o);
}
}