mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-23 08:46: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());
|
||||
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()));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user