Fix controls shadows on call panel.

This commit is contained in:
John Preston 2020-08-21 12:04:19 +04:00
parent c7881ae4a3
commit ade7745b0b
4 changed files with 6 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -100,11 +100,11 @@ void Panel::Incoming::paintEvent(QPaintEvent *e) {
const auto frame = _track->frame(Webrtc::FrameRequest());
if (frame.isNull()) {
p.fillRect(e->rect(), Qt::black);
fillBottomShadow(p);
fillTopShadow(p);
} else {
auto hq = PainterHighQualityEnabler(p);
p.drawImage(rect(), frame);
fillBottomShadow(p);
fillTopShadow(p);
}
_track->markFrameShown();
}
@ -137,13 +137,13 @@ void Panel::Incoming::fillTopShadow(QPainter &p) {
const auto shadowArea = QRect(
position,
st::callTitleShadow.size());
const auto fill = shadowArea.intersected(geometry()).translated(-x(), -y());
const auto fill = shadowArea.intersected(geometry()).translated(-pos());
if (fill.isEmpty()) {
return;
}
p.save();
p.setClipRect(fill);
st::callTitleShadow.paint(p, position, width);
st::callTitleShadow.paint(p, position - pos(), width);
p.restore();
#endif // Q_OS_WIN
}
@ -154,7 +154,7 @@ void Panel::Incoming::fillBottomShadow(QPainter &p) {
parentWidget()->height() - st::callBottomShadowSize,
parentWidget()->width(),
st::callBottomShadowSize);
const auto fill = shadowArea.intersected(geometry()).translated(-x(), -y());
const auto fill = shadowArea.intersected(geometry()).translated(-pos());
if (fill.isEmpty()) {
return;
}
@ -164,7 +164,7 @@ void Panel::Incoming::fillBottomShadow(QPainter &p) {
_bottomShadow,
QRect(
0,
factor * (fill.y() - shadowArea.y()),
factor * (fill.y() - shadowArea.translated(-pos()).y()),
factor,
factor * fill.height()));
}