diff --git a/Telegram/Resources/icons/calls_shadow_controls.png b/Telegram/Resources/icons/calls_shadow_controls.png new file mode 100644 index 000000000..0f7ba18fa Binary files /dev/null and b/Telegram/Resources/icons/calls_shadow_controls.png differ diff --git a/Telegram/Resources/icons/calls_shadow_controls@2x.png b/Telegram/Resources/icons/calls_shadow_controls@2x.png new file mode 100644 index 000000000..a88649642 Binary files /dev/null and b/Telegram/Resources/icons/calls_shadow_controls@2x.png differ diff --git a/Telegram/Resources/icons/calls_shadow_controls@3x.png b/Telegram/Resources/icons/calls_shadow_controls@3x.png new file mode 100644 index 000000000..d137b07de Binary files /dev/null and b/Telegram/Resources/icons/calls_shadow_controls@3x.png differ diff --git a/Telegram/SourceFiles/calls/calls.style b/Telegram/SourceFiles/calls/calls.style index f9ee36efb..948025114 100644 --- a/Telegram/SourceFiles/calls/calls.style +++ b/Telegram/SourceFiles/calls/calls.style @@ -370,3 +370,4 @@ callTitle: WindowTitle(defaultWindowTitle) { closeIconActive: callTitleCloseIcon; closeIconActiveOver: callTitleCloseIconOver; } +callTitleShadow: icon {{ "calls_shadow_controls", windowShadowFg }}; diff --git a/Telegram/SourceFiles/calls/calls_panel.cpp b/Telegram/SourceFiles/calls/calls_panel.cpp index f334c4e78..34b7950c8 100644 --- a/Telegram/SourceFiles/calls/calls_panel.cpp +++ b/Telegram/SourceFiles/calls/calls_panel.cpp @@ -626,6 +626,45 @@ void Panel::initBottomShadow() { _bottomShadow = Images::PixmapFast(std::move(image)); } +void Panel::fillTopShadow(QPainter &p, QRect incoming) { +#ifdef Q_OS_WIN + const auto width = widget()->width(); + const auto position = QPoint(width - st::callTitleShadow.width(), 0); + const auto shadowArea = QRect( + position, + st::callTitleShadow.size()); + const auto fill = shadowArea.intersected(incoming); + if (fill.isEmpty()) { + return; + } + p.save(); + p.setClipRect(fill); + st::callTitleShadow.paint(p, position, width); + p.restore(); +#endif // Q_OS_WIN +} + +void Panel::fillBottomShadow(QPainter &p, QRect incoming) { + const auto shadowArea = QRect( + 0, + widget()->height() - st::callBottomShadowSize, + widget()->width(), + st::callBottomShadowSize); + const auto fill = shadowArea.intersected(incoming); + if (fill.isEmpty()) { + return; + } + const auto factor = cIntRetinaFactor(); + p.drawPixmap( + fill, + _bottomShadow, + QRect( + 0, + factor * (fill.y() - shadowArea.y()), + factor, + factor * fill.height())); +} + void Panel::showControls() { Expects(_call != nullptr); @@ -844,23 +883,8 @@ void Panel::paint(QRect clip) { auto hq = PainterHighQualityEnabler(p); p.drawImage(incoming, frame); } - const auto shadowArea = QRect( - 0, - widget()->height() - st::callBottomShadowSize, - widget()->width(), - st::callBottomShadowSize); - const auto fill = shadowArea.intersected(incoming); - if (!fill.isEmpty()) { - const auto factor = cIntRetinaFactor(); - p.drawPixmap( - fill, - _bottomShadow, - QRect( - 0, - factor * (fill.y() - shadowArea.y()), - factor, - factor * fill.height())); - } + fillBottomShadow(p, incoming); + fillTopShadow(p, incoming); } _call->videoIncoming()->markFrameShown(); diff --git a/Telegram/SourceFiles/calls/calls_panel.h b/Telegram/SourceFiles/calls/calls_panel.h index 30a3d38ca..c57ca6070 100644 --- a/Telegram/SourceFiles/calls/calls_panel.h +++ b/Telegram/SourceFiles/calls/calls_panel.h @@ -95,6 +95,8 @@ private: void startDurationUpdateTimer(crl::time currentDuration); void fillFingerprint(); void setIncomingSize(QSize size); + void fillTopShadow(QPainter &p, QRect incoming); + void fillBottomShadow(QPainter &p, QRect incoming); void refreshOutgoingPreviewInBody(State state); void toggleFullScreen(bool fullscreen);