mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-23 16:56:55 +00:00
Fix controls shadows on call panel.
This commit is contained in:
parent
c7881ae4a3
commit
ade7745b0b
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 |
@ -100,11 +100,11 @@ void Panel::Incoming::paintEvent(QPaintEvent *e) {
|
|||||||
const auto frame = _track->frame(Webrtc::FrameRequest());
|
const auto frame = _track->frame(Webrtc::FrameRequest());
|
||||||
if (frame.isNull()) {
|
if (frame.isNull()) {
|
||||||
p.fillRect(e->rect(), Qt::black);
|
p.fillRect(e->rect(), Qt::black);
|
||||||
fillBottomShadow(p);
|
|
||||||
fillTopShadow(p);
|
|
||||||
} else {
|
} else {
|
||||||
auto hq = PainterHighQualityEnabler(p);
|
auto hq = PainterHighQualityEnabler(p);
|
||||||
p.drawImage(rect(), frame);
|
p.drawImage(rect(), frame);
|
||||||
|
fillBottomShadow(p);
|
||||||
|
fillTopShadow(p);
|
||||||
}
|
}
|
||||||
_track->markFrameShown();
|
_track->markFrameShown();
|
||||||
}
|
}
|
||||||
@ -137,13 +137,13 @@ void Panel::Incoming::fillTopShadow(QPainter &p) {
|
|||||||
const auto shadowArea = QRect(
|
const auto shadowArea = QRect(
|
||||||
position,
|
position,
|
||||||
st::callTitleShadow.size());
|
st::callTitleShadow.size());
|
||||||
const auto fill = shadowArea.intersected(geometry()).translated(-x(), -y());
|
const auto fill = shadowArea.intersected(geometry()).translated(-pos());
|
||||||
if (fill.isEmpty()) {
|
if (fill.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
p.save();
|
p.save();
|
||||||
p.setClipRect(fill);
|
p.setClipRect(fill);
|
||||||
st::callTitleShadow.paint(p, position, width);
|
st::callTitleShadow.paint(p, position - pos(), width);
|
||||||
p.restore();
|
p.restore();
|
||||||
#endif // Q_OS_WIN
|
#endif // Q_OS_WIN
|
||||||
}
|
}
|
||||||
@ -154,7 +154,7 @@ void Panel::Incoming::fillBottomShadow(QPainter &p) {
|
|||||||
parentWidget()->height() - st::callBottomShadowSize,
|
parentWidget()->height() - st::callBottomShadowSize,
|
||||||
parentWidget()->width(),
|
parentWidget()->width(),
|
||||||
st::callBottomShadowSize);
|
st::callBottomShadowSize);
|
||||||
const auto fill = shadowArea.intersected(geometry()).translated(-x(), -y());
|
const auto fill = shadowArea.intersected(geometry()).translated(-pos());
|
||||||
if (fill.isEmpty()) {
|
if (fill.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -164,7 +164,7 @@ void Panel::Incoming::fillBottomShadow(QPainter &p) {
|
|||||||
_bottomShadow,
|
_bottomShadow,
|
||||||
QRect(
|
QRect(
|
||||||
0,
|
0,
|
||||||
factor * (fill.y() - shadowArea.y()),
|
factor * (fill.y() - shadowArea.translated(-pos()).y()),
|
||||||
factor,
|
factor,
|
||||||
factor * fill.height()));
|
factor * fill.height()));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user