mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-03 05:31:52 +00:00
Fix service message highlighting.
This commit is contained in:
parent
81790b2271
commit
a441a9fca9
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user