From 801435e57cf68ba68df1c8e4b290b970d6aa3fa5 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 7 May 2021 13:55:46 +0400 Subject: [PATCH] Show participant names in narrow column. --- .../Resources/icons/calls/voice_mute_mini.png | Bin 0 -> 521 bytes .../icons/calls/voice_mute_mini@2x.png | Bin 0 -> 1023 bytes .../icons/calls/voice_mute_mini@3x.png | Bin 0 -> 1464 bytes Telegram/SourceFiles/boxes/peer_list_box.h | 2 +- Telegram/SourceFiles/calls/calls.style | 20 ++ .../calls/group/calls_group_members.cpp | 193 +++++++++++++++--- .../calls/group/calls_group_panel.cpp | 3 +- Telegram/lib_ui | 2 +- 8 files changed, 191 insertions(+), 29 deletions(-) create mode 100644 Telegram/Resources/icons/calls/voice_mute_mini.png create mode 100644 Telegram/Resources/icons/calls/voice_mute_mini@2x.png create mode 100644 Telegram/Resources/icons/calls/voice_mute_mini@3x.png diff --git a/Telegram/Resources/icons/calls/voice_mute_mini.png b/Telegram/Resources/icons/calls/voice_mute_mini.png new file mode 100644 index 0000000000000000000000000000000000000000..75615e4b000a2f0203a81f5133862ba8bc20c873 GIT binary patch literal 521 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjjKx9jP7LeL$-D$|Tv8)E(|mmy zw18|52FCVG1{RPKAeI7R1_tH@j10^`nh_+nfC(-uv49!D1}S`GTDlfwwx^3@hzIZ6 zkb|q597JTFy6VQbToB*Vy{(b^|6=|^&9%`ktL+y4f59H*GNHp>q2u(0x%0};FFDBU zu9_j7|G=uf_`L1(oqbVWnjSSdH|2}h_5PRs;#YB@Lv3>Bt@q!xJcVSBJpQ=j`X0d# zVx`AER=5O;+<04N)p7Fc)vG`AicfF)P+=p$a`5zo8FO-P>z})_rrhO{gJs|1MH)i= z&z027=lV&X+VS1YAdJtarjWUEV%F}vS`4dnPTPNe_U7ct+)GkfyTe}lTFCHqJdSvN z?)m0p>s~iG&YLqM%SU&k;w|CXXW2qS6L-cWZH!Rhake~DEI2v2Pb!P|*^}GSC#HAZ ze%to?YuC-3wu>1pU#r$O&yXp;5|I7L&@AC#)>fx!sUDX__Psy+*+%xrlNpPb9llf3 zv@FAJ{^JrW#q*!joTMfvue&(2Y_;EsYkQw;U!XU=TkPbDDQEWWUU2RoPf%w^+xOqG sr`u-*+x%d;^|SZ5_Q7d6l6xZ>_Z1Wkp00i_>zopr0L3-gKL7v# literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/calls/voice_mute_mini@2x.png b/Telegram/Resources/icons/calls/voice_mute_mini@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..9eec8a1b38533808c1d10457a29f86364dcc544b GIT binary patch literal 1023 zcmVPx#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91FrWhf1ONa40RR91FaQ7m0NXcg3;+NFX-PyuRA>e5SiMeaK@eX4VnIl> zk%Y!*gBU6r42hA>+QK)mP@jQ>*)2jMDVWh^W#P_x-2CxQ+(w$}TMV+VXV9Hy(Q zs}bz?_xFUM6Kr5>F$p^f6bc1}^XBG;ve~Qx2_7;@u>GeJ2m}JuZnp)#*Vk7{r_;Xy zgbX?mY~f=m3GW@imXLIDap4FII!W{M^Nw~ViCH-o^wZ_;?vAfNnRMOU+}va%L#dSn z^fh^f^~Vu@nr_6<;K6zV25Va}^%JmCMh`*!4tOY@71#f-12Z!-tWv3n0e+k&$)t_0 z8xDs;{HJ)*ciL?9i@3SDDSu39YimpR@*gt#`1la=+uK{mc+i1h8;wSV9b!mAY!1|D z7;mBX_jgr{R4OHS4oKYp@vyYC#CCUgm5pQ|gARoEgO`^V!LO{Wh#4PxY$f~xW0Y|w zlaU3ZTCJvh*Voro7f|79wMrWs8)AT$9l{J-j!O*0kc8M$ZZMm*3>UY@$49Yduh&ys z0SlJPWr@XchK&S=ZG;#g#B}+dV3q(DKR!NI0E@+<0tDUm_BM4o9i^8HWY9_QnBgl4 zF?F2*Z=OIhnWVS3H?elV->22p)se;H@i^`5?9k!ip%~yH(?P)pz97UxOkHolnHJWwu|`!WF7!bcKf82}!)b(cUS5}~uRGl@aGZIwzTnw^~;UqC%W2OIfj z24}=TEVl^+J{|dFP8<-c*Xt~w&nsvAm2!G|%J@GJjK9zec_NWuYinzapGqtiiz(Yi zqrv#u&z_&3mCOy}I(xpDI63zB_eZL#+Ty^V1MqQq>Wt%cw}k*+AB&5NbaZq?Pft${ zuu14(16$qKBR>knV=xMZLgEX3a&n>)0go>(bYA0+`x{>+cz~&d>%jT>Icv3A$__ka zZm$X|&;-VM0&H7Lw4DgVB$MAHFS}daLP~WzNTq81c t^b;^Fn00f%1J+Aw7|`#4VZp4M{{pDH3w$NXWFY_m002ovPDHLkV1h^IwDkZ0 literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/calls/voice_mute_mini@3x.png b/Telegram/Resources/icons/calls/voice_mute_mini@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..668b4a92b95b371fec9bef74cf000ccc2b89cd26 GIT binary patch literal 1464 zcmah}dols0atPL9C*{Tq_Zo$e*TTK`7ULQiJHU#Z) zy6$vHqf50X(V}P6YsAq7t7j1EJ*|kxS#0NQf9{X(e&4Qw&i2Gyzlrw@!Qm%vp3P`4uBe8aDRmSaxY(S1#hHc80|Q~Jf$$D)I} z!JZCgrTJ0FXi1a=2@N1wLZO6_F?-L$5qIODP0~`U{PN#-=d;rLx%V@gUcC3b(D-WZ z$wF`M);@RDE4iOwl^6QXF#rp5Zx?d+17EAu+o?lY>OnaSW{N|XN<9|aCNQFcNU*y2 zF$f<(>V@)B)T0@OhwLN*rXv=jX1J6W85$dF79A5~g~#Ki3kz>A$`W;i6Ih8ZYJ72V zQMR(;OxCBus)|fr(K#AFibPzDkIxg{x}23C%*3Lgp^1qII-UNptVEz{A>)9NZ=DdC zTGe8)xH_8{5RgClL80I{Iy;w%MBW!#TU%>3x3<{R(+R#So15j~k&*1Jtt<*gmh-e3 z<>n@HxHmjZ=2TUExCzRbe5+=rrN{28ZeCtafltiLByvhi^yduT>^tdBFX0G zZEGEtmzKh9#)gNF$zBI$W(r6lh@xbBJ2W~h$S_wdCM7*&l@`A*EWh>=Kz(|6kHhIs z&>0*XGkYNvY7ucVUohWmc6N5X1H1DpP}UqzhKB^0_wWgXD{{_*JP_4JBo{?73{7Gf ze=m#{>uU^CSAhr`U{IC{NPR5gpM5v{!tCzu?rLvm4h_sBYi60kXL5yNn#iu*g)m)o zo;BRk)zJ~=pHw(nHc`^>k2W^aOMdIwpm%kJlgYxk_Ftq@*mMaAqwTjA-cOgqF#NkW`1b_rESi}foak5eZk579b>PqH8nG#`SrCt6FunX1|jFiyo=Ncsi~<^j&OSi( z>}+lUW{%2qrtzdA@KG-~xTfjB(RAacr-OrMFcH@-U!HZ?8Xb-4#<)P!2es-{&tU@3 ze!13WkT99#y7>_l9v0Toxwz@+;c*@GTp$n^7HZVe>NUIk@WIA{BtI?w+3G|(0B3b{ z_`~PeYy(bB%?k7-pI_G4(4fhm0<&^{uC}J}b&Hul?0yaZ@W$;OG&C#gxt=Q+jYhYs zy^mivfQwEp=bXDWHsvuz}&WOPQJP<~3TcniA+hBocih4DG=vRz)SU@tpkIJ@rdkyIYl0 zQxufDJ3#`qyg3oFl+U82rh1%@PD@L($Z2o)Ysa{==jM{jYHL>`6VOX$-lnFe@S&k0 z%C?8Cs<*0R=%`rix4N?O2itN>Ul4B~&~`-x+wIf@+uGR3dU{Uv0=}P}i0=W8H|nB+ z7n(+fh6C&C>%4FHL0uGW<*+X^wJiHo-q;rO@p5uU6@v*CYf4;~M?qnSTKiJBwWa literal 0 HcmV?d00001 diff --git a/Telegram/SourceFiles/boxes/peer_list_box.h b/Telegram/SourceFiles/boxes/peer_list_box.h index abce0b55b..44b52d5ec 100644 --- a/Telegram/SourceFiles/boxes/peer_list_box.h +++ b/Telegram/SourceFiles/boxes/peer_list_box.h @@ -122,7 +122,7 @@ public: bool actionSelected) { } - void refreshName(const style::PeerListItem &st); + virtual void refreshName(const style::PeerListItem &st); const Ui::Text::String &name() const { return _name; } diff --git a/Telegram/SourceFiles/calls/calls.style b/Telegram/SourceFiles/calls/calls.style index 0344576f4..c5773c259 100644 --- a/Telegram/SourceFiles/calls/calls.style +++ b/Telegram/SourceFiles/calls/calls.style @@ -1134,6 +1134,10 @@ desktopCaptureSubmit: RoundButton(desktopCaptureCancel) { groupCallNarrowSkip: 9px; groupCallNarrowRowSkip: 8px; groupCallNarrowSize: size(144px, 90px); +groupCallNarrowUserpicTop: 12px; +groupCallNarrowNameTop: 65px; +groupCallNarrowIconTop: 62px; +groupCallNarrowIconLess: 5px; groupCallWideModeWidthMin: 520px; groupCallWideModeSize: size(720px, 480px); groupCallNarrowAddMemberHeight: 32px; @@ -1149,3 +1153,19 @@ groupCallNarrowAddMember: RoundButton(defaultActiveButton) { ripple: groupCallRipple; } +groupCallNarrowInactiveCrossLine: CrossLineAnimation { + fg: groupCallMemberInactiveIcon; + icon: icon {{ "calls/voice_mute_mini", groupCallMemberInactiveIcon }}; + startPosition: point(7px, 4px); + endPosition: point(17px, 15px); + stroke: 3px; + strokeDenominator: 2; +} +groupCallNarrowColoredCrossLine: CrossLineAnimation(groupCallNarrowInactiveCrossLine) { + fg: groupCallMemberMutedIcon; + icon: icon {{ "calls/voice_mute_mini", groupCallMemberActiveIcon }}; +} +groupCallVideoCrossLine: CrossLineAnimation(groupCallNarrowInactiveCrossLine) { + fg: groupCallVideoTextFg; + icon: icon {{ "calls/voice_mute_mini", groupCallVideoTextFg }}; +} diff --git a/Telegram/SourceFiles/calls/group/calls_group_members.cpp b/Telegram/SourceFiles/calls/group/calls_group_members.cpp index 215ca29d4..140085902 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_members.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_members.cpp @@ -26,6 +26,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/widgets/scroll_area.h" #include "ui/widgets/popup_menu.h" #include "ui/text/text_utilities.h" +#include "ui/text/text_options.h" #include "ui/effects/ripple_animation.h" #include "ui/effects/cross_line.h" #include "ui/round_rect.h" @@ -82,6 +83,12 @@ auto RowBlobs() -> std::array { class Row; +enum class NarrowStyle { + None, + Userpic, + Video, +}; + class RowDelegate { public: struct IconState { @@ -90,6 +97,7 @@ public: float64 muted = 0.; bool mutedByMe = false; bool raisedHand = false; + NarrowStyle narrowStyle = NarrowStyle::None; }; virtual bool rowIsMe(not_null participantPeer) = 0; virtual bool rowCanMuteMembers() = 0; @@ -98,8 +106,8 @@ public: virtual void rowPaintIcon( Painter &p, QRect rect, - IconState state) = 0; - virtual void rowPaintWideBackground(Painter &p, bool selected) = 0; + const IconState &state) = 0; + virtual void rowPaintNarrowBackground(Painter &p, bool selected) = 0; }; class Row final : public PeerListRow { @@ -154,6 +162,8 @@ public: void addActionRipple(QPoint point, Fn updateCallback) override; void stopLastActionRipple() override; + void refreshName(const style::PeerListItem &st) override; + QSize actionSize() const override { return QSize( st::groupCallActiveButton.width, @@ -264,7 +274,7 @@ private: int sizew, int sizeh, PanelMode mode); - [[nodiscard]] static std::tuple UserpicInWideMode( + [[nodiscard]] static std::tuple UserpicInNarrowMode( int x, int y, int sizew, @@ -284,6 +294,15 @@ private: int sizew, int sizeh, PanelMode mode); + void paintNarrowName( + Painter &p, + int x, + int y, + int sizew, + int sizeh, + NarrowStyle style); + [[nodiscard]] RowDelegate::IconState computeIconState( + NarrowStyle style = NarrowStyle::None) const; const not_null _delegate; State _state = State::Inactive; @@ -297,6 +316,7 @@ private: Ui::Animations::Simple _speakingAnimation; // For gray-red/green icon. Ui::Animations::Simple _mutedAnimation; // For gray/red icon. Ui::Animations::Simple _activeAnimation; // For icon cross animation. + Ui::Text::String _narrowName; QString _aboutText; crl::time _speakingLastTime = 0; uint64 _raisedHandRating = 0; @@ -346,8 +366,8 @@ public: void rowPaintIcon( Painter &p, QRect rect, - IconState state) override; - void rowPaintWideBackground(Painter &p, bool selected) override; + const IconState &state) override; + void rowPaintNarrowBackground(Painter &p, bool selected) override; int customRowHeight() override; void customRowPaint( @@ -436,8 +456,11 @@ private: Ui::CrossLineAnimation _inactiveCrossLine; Ui::CrossLineAnimation _coloredCrossLine; - Ui::RoundRect _wideRoundRectSelected; - Ui::RoundRect _wideRoundRect; + Ui::CrossLineAnimation _inactiveNarrowCrossLine; + Ui::CrossLineAnimation _coloredNarrowCrossLine; + Ui::CrossLineAnimation _videoNarrowCrossLine; + Ui::RoundRect _narrowRoundRectSelected; + Ui::RoundRect _narrowRoundRect; rpl::lifetime _lifetime; @@ -749,15 +772,14 @@ bool Row::paintVideo( return true; } -std::tuple Row::UserpicInWideMode( +std::tuple Row::UserpicInNarrowMode( int x, int y, int sizew, int sizeh) { const auto useSize = st::groupCallMembersList.item.photoSize; const auto skipx = (sizew - useSize) / 2; - const auto skipy = (sizeh - useSize) / 2; - return { x + skipx, y + skipy, useSize }; + return { x + skipx, y + st::groupCallNarrowUserpicTop, useSize }; } void Row::paintBlobs( @@ -772,7 +794,7 @@ void Row::paintBlobs( } auto size = sizew; if (mode == PanelMode::Wide) { - std::tie(x, y, size) = UserpicInWideMode(x, y, sizew, sizeh); + std::tie(x, y, size) = UserpicInNarrowMode(x, y, sizew, sizeh); } const auto mutedByMe = (_state == State::MutedByMe); const auto shift = QPointF(x + size / 2., y + size / 2.); @@ -800,7 +822,7 @@ void Row::paintScaledUserpic( PanelMode mode) { auto size = sizew; if (mode == PanelMode::Wide) { - std::tie(x, y, size) = UserpicInWideMode(x, y, sizew, sizeh); + std::tie(x, y, size) = UserpicInNarrowMode(x, y, sizew, sizeh); } if (!_blobsAnimation) { peer()->paintUserpicLeft(p, userpic, x, y, outerWidth, size); @@ -834,6 +856,70 @@ void Row::paintScaledUserpic( _blobsAnimation->userpicCache); } +void Row::paintNarrowName( + Painter &p, + int x, + int y, + int sizew, + int sizeh, + NarrowStyle style) { + if (_narrowName.isEmpty()) { + _narrowName.setText( + st::semiboldTextStyle, + generateShortName(), + Ui::NameTextOptions()); + } + const auto &icon = st::groupCallVideoCrossLine.icon; + const auto added = icon.width() - st::groupCallNarrowIconLess; + const auto available = sizew - 2 * st::normalFont->spacew - added; + const auto use = std::min(available, _narrowName.maxWidth()); + const auto left = (sizew - use - added) / 2; + const auto iconRect = QRect( + left - st::groupCallNarrowIconLess, + y + st::groupCallNarrowIconTop, + icon.width(), + icon.height()); + const auto &state = computeIconState(style); + _delegate->rowPaintIcon(p, iconRect, state); + + p.setPen([&] { + if (style == NarrowStyle::Video) { + return st::groupCallVideoTextFg->p; + } else if (state.speaking == 1. && !state.mutedByMe) { + return st::groupCallMemberActiveIcon->p; + } else if (state.speaking == 0.) { + if (state.active == 1.) { + return st::groupCallMemberInactiveIcon->p; + } else if (state.active == 0.) { + if (state.muted == 1.) { + return state.raisedHand + ? st::groupCallMemberInactiveStatus->p + : st::groupCallMemberMutedIcon->p; + } else if (state.muted == 0.) { + return st::groupCallMemberInactiveIcon->p; + } + } + } + const auto activeInactiveColor = anim::color( + st::groupCallMemberInactiveIcon, + (state.mutedByMe + ? st::groupCallMemberMutedIcon + : st::groupCallMemberActiveIcon), + state.speaking); + return anim::pen( + activeInactiveColor, + st::groupCallMemberMutedIcon, + state.muted); + }()); + const auto nameLeft = iconRect.x() + icon.width(); + const auto nameTop = y + st::groupCallNarrowNameTop; + if (use == available) { + _narrowName.drawLeftElided(p, nameLeft, nameTop, available, sizew); + } else { + _narrowName.drawLeft(p, nameLeft, nameTop, available, sizew); + } +} + auto Row::generatePaintUserpicCallback() -> PaintRoundImageCallback { return [=](Painter &p, int x, int y, int outerWidth, int size) { const auto outer = outerWidth; @@ -852,9 +938,10 @@ void Row::paintComplexUserpic( bool selected) { if (mode == PanelMode::Wide) { if (paintVideo(p, x, y, sizew, sizeh, mode)) { + paintNarrowName(p, x, y, sizew, sizeh, NarrowStyle::Video); return; } - _delegate->rowPaintWideBackground(p, selected); + _delegate->rowPaintNarrowBackground(p, selected); paintRipple(p, x, y, outerWidth); } paintBlobs(p, x, y, sizew, sizeh, mode); @@ -871,6 +958,9 @@ void Row::paintComplexUserpic( sizew, sizeh, mode); + if (mode == PanelMode::Wide) { + paintNarrowName(p, x, y, sizew, sizeh, NarrowStyle::Userpic); + } } int Row::statusIconWidth() const { @@ -1043,18 +1133,23 @@ void Row::paintAction( _actionRipple.reset(); } } + _delegate->rowPaintIcon(p, iconRect, computeIconState()); +} + +RowDelegate::IconState Row::computeIconState(NarrowStyle style) const { const auto speaking = _speakingAnimation.value(_speaking ? 1. : 0.); const auto active = _activeAnimation.value((_state == State::Active) ? 1. : 0.); const auto muted = _mutedAnimation.value( (_state == State::Muted || _state == State::RaisedHand) ? 1. : 0.); const auto mutedByMe = (_state == State::MutedByMe); - _delegate->rowPaintIcon(p, iconRect, { + return { .speaking = speaking, .active = active, .muted = muted, .mutedByMe = (_state == State::MutedByMe), .raisedHand = (_state == State::RaisedHand), - }); + .narrowStyle = style, + }; } void Row::refreshStatus() { @@ -1115,6 +1210,11 @@ void Row::addActionRipple(QPoint point, Fn updateCallback) { _actionRipple->add(point - st::groupCallActiveButton.rippleAreaPosition); } +void Row::refreshName(const style::PeerListItem &st) { + PeerListRow::refreshName(st); + _narrowName = Ui::Text::String(); +} + void Row::stopLastActionRipple() { if (_actionRipple) { _actionRipple->lastStop(); @@ -1130,14 +1230,22 @@ MembersController::MembersController( , _raisedHandStatusRemoveTimer([=] { scheduleRaisedHandStatusRemove(); }) , _inactiveCrossLine(st::groupCallMemberInactiveCrossLine) , _coloredCrossLine(st::groupCallMemberColoredCrossLine) -, _wideRoundRectSelected(ImageRoundRadius::Large, st::groupCallMembersBgOver) -, _wideRoundRect(ImageRoundRadius::Large, st::groupCallMembersBg) { +, _inactiveNarrowCrossLine(st::groupCallNarrowInactiveCrossLine) +, _coloredNarrowCrossLine(st::groupCallNarrowColoredCrossLine) +, _videoNarrowCrossLine(st::groupCallVideoCrossLine) +, _narrowRoundRectSelected( + ImageRoundRadius::Large, + st::groupCallMembersBgOver) +, _narrowRoundRect(ImageRoundRadius::Large, st::groupCallMembersBg) { setupListChangeViewers(); style::PaletteChanged( ) | rpl::start_with_next([=] { _inactiveCrossLine.invalidate(); _coloredCrossLine.invalidate(); + _inactiveNarrowCrossLine.invalidate(); + _coloredNarrowCrossLine.invalidate(); + _videoNarrowCrossLine.invalidate(); }, _lifetime); rpl::combine( @@ -1812,8 +1920,14 @@ void MembersController::scheduleRaisedHandStatusRemove() { void MembersController::rowPaintIcon( Painter &p, QRect rect, - IconState state) { - const auto &greenIcon = st::groupCallMemberColoredCrossLine.icon; + const IconState &state) { + const auto narrowUserpic = (state.narrowStyle == NarrowStyle::Userpic); + const auto narrowVideo = (state.narrowStyle == NarrowStyle::Video); + const auto &greenIcon = narrowVideo + ? st::groupCallVideoCrossLine.icon + : narrowUserpic + ? st::groupCallNarrowColoredCrossLine.icon + : st::groupCallMemberColoredCrossLine.icon; const auto left = rect.x() + (rect.width() - greenIcon.width()) / 2; const auto top = rect.y() + (rect.height() - greenIcon.height()) / 2; if (state.speaking == 1. && !state.mutedByMe) { @@ -1823,25 +1937,44 @@ void MembersController::rowPaintIcon( } else if (state.speaking == 0.) { if (state.active == 1.) { // Just gray icon, no cross, no coloring. - st::groupCallMemberInactiveCrossLine.icon.paintInCenter(p, rect); + const auto &grayIcon = narrowVideo + ? st::groupCallVideoCrossLine.icon + : narrowUserpic + ? st::groupCallNarrowInactiveCrossLine.icon + : st::groupCallMemberInactiveCrossLine.icon; + grayIcon.paintInCenter(p, rect); return; } else if (state.active == 0.) { if (state.muted == 1.) { if (state.raisedHand) { + // #TODO narrow mode icon st::groupCallMemberRaisedHand.paintInCenter(p, rect); return; } // Red crossed icon, colorized once, cached as last frame. - _coloredCrossLine.paint( + auto &line = narrowVideo + ? _videoNarrowCrossLine + : narrowUserpic + ? _coloredNarrowCrossLine + : _coloredCrossLine; + const auto color = narrowVideo + ? std::nullopt + : std::make_optional(st::groupCallMemberMutedIcon->c); + line.paint( p, left, top, 1., - st::groupCallMemberMutedIcon->c); + color); return; } else if (state.muted == 0.) { // Gray crossed icon, no coloring, cached as last frame. - _inactiveCrossLine.paint(p, left, top, 1.); + auto &line = narrowVideo + ? _videoNarrowCrossLine + : narrowUserpic + ? _inactiveNarrowCrossLine + : _inactiveCrossLine; + line.paint(p, left, top, 1.); return; } } @@ -1856,15 +1989,23 @@ void MembersController::rowPaintIcon( activeInactiveColor, st::groupCallMemberMutedIcon, state.muted); + const auto color = narrowVideo + ? std::nullopt + : std::make_optional(iconColor); // Don't use caching of the last frame, // because 'muted' may animate color. const auto crossProgress = std::min(1. - state.active, 0.9999); - _inactiveCrossLine.paint(p, left, top, crossProgress, iconColor); + auto &line = narrowVideo + ? _videoNarrowCrossLine + : narrowUserpic + ? _inactiveNarrowCrossLine + : _inactiveCrossLine; + line.paint(p, left, top, crossProgress, color); } -void MembersController::rowPaintWideBackground(Painter &p, bool selected) { - (selected ? _wideRoundRectSelected : _wideRoundRect).paint( +void MembersController::rowPaintNarrowBackground(Painter &p, bool selected) { + (selected ? _narrowRoundRectSelected : _narrowRoundRect).paint( p, { QPoint(st::groupCallNarrowSkip, 0), st::groupCallNarrowSize }); } diff --git a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp index d2940855a..87cf7e333 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp @@ -996,6 +996,7 @@ void Panel::raiseControls() { void Panel::setupPinnedVideo() { _pinnedVideo.create(widget()); _pinnedVideo->setVisible(_mode == PanelMode::Wide); + _pinnedVideo->setAttribute(Qt::WA_OpaquePaintEvent, true); raiseControls(); @@ -1026,7 +1027,7 @@ void Panel::setupPinnedVideo() { }, _pinnedTrackLifetime); _pinnedVideo->paintRequest( - ) | rpl::start_with_next([=] { + ) | rpl::start_with_next([=](QRect clip) { const auto [image, rotation] = track->frameOriginalWithRotation(); if (image.isNull()) { diff --git a/Telegram/lib_ui b/Telegram/lib_ui index b0c5d9220..52326fffd 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit b0c5d9220bb8f0fc614712167c8276504e60b224 +Subproject commit 52326fffd0297271f5d56c3c2fefd2bfb453f91a