Rename LargeVideo to Video in voice chats.

This commit is contained in:
John Preston 2021-05-30 18:46:51 +04:00
parent 90efbf1210
commit 97c7c0742c
12 changed files with 70 additions and 120 deletions

View file

@ -1170,29 +1170,8 @@ desktopCaptureSubmit: RoundButton(desktopCaptureCancel) {
groupCallNarrowSkip: 9px; groupCallNarrowSkip: 9px;
groupCallNarrowMembersWidth: 204px; groupCallNarrowMembersWidth: 204px;
groupCallNarrowVideoHeight: 120px; groupCallNarrowVideoHeight: 120px;
//groupCallNarrowRowSkip: 4px;
//groupCallNarrowSize: size(144px, 90px);
//groupCallNarrowUserpicTop: 13px;
//groupCallNarrowNameTop: 65px;
//groupCallNarrowIconTop: 62px;
//groupCallNarrowIconLess: 5px;
groupCallWideModeWidthMin: 600px; groupCallWideModeWidthMin: 600px;
groupCallWideModeSize: size(960px, 580px); groupCallWideModeSize: size(960px, 580px);
//groupCallNarrowAddMemberHeight: 32px;
//groupCallNarrowOutline: 2px;
//groupCallNarrowShadowHeight: 36px;
//groupCallNarrowAddMember: RoundButton(defaultActiveButton) {
// textFg: groupCallMemberNotJoinedStatus;
// textFgOver: groupCallMemberNotJoinedStatus;
// textBg: groupCallMembersBg;
// textBgOver: groupCallMembersBgOver;
//
// height: 32px;
// radius: roundRadiusLarge;
//
// ripple: groupCallRipple;
//}
groupCallNarrowInactiveCrossLine: CrossLineAnimation { groupCallNarrowInactiveCrossLine: CrossLineAnimation {
fg: groupCallMemberNotJoinedStatus; fg: groupCallMemberNotJoinedStatus;
icon: icon {{ "calls/video_mini_mute", groupCallMemberNotJoinedStatus }}; icon: icon {{ "calls/video_mini_mute", groupCallMemberNotJoinedStatus }};
@ -1210,17 +1189,13 @@ groupCallNarrowCameraIcon: icon {{ "calls/video_mini_video", groupCallMemberNotJ
groupCallNarrowScreenIcon: icon {{ "calls/video_mini_screencast", groupCallMemberNotJoinedStatus }}; groupCallNarrowScreenIcon: icon {{ "calls/video_mini_screencast", groupCallMemberNotJoinedStatus }};
groupCallNarrowIconPosition: point(-4px, 2px); groupCallNarrowIconPosition: point(-4px, 2px);
groupCallNarrowIconSkip: 15px; groupCallNarrowIconSkip: 15px;
//groupCallVideoCrossLine: CrossLineAnimation(groupCallNarrowInactiveCrossLine) {
// fg: groupCallVideoTextFg;
// icon: icon {{ "calls/voice_mute_mini", groupCallVideoTextFg }};
//}
groupCallOutline: 2px; groupCallOutline: 2px;
groupCallLargeVideoCrossLine: CrossLineAnimation(groupCallMemberColoredCrossLine) { groupCallVideoCrossLine: CrossLineAnimation(groupCallMemberColoredCrossLine) {
fg: groupCallVideoTextFg; fg: groupCallVideoTextFg;
icon: icon {{ "calls/video_over_mute", groupCallVideoTextFg }}; icon: icon {{ "calls/video_over_mute", groupCallVideoTextFg }};
} }
GroupCallLargeVideo { GroupCallVideoTile {
shadowHeight: pixels; shadowHeight: pixels;
namePosition: point; namePosition: point;
pin: CrossLineAnimation; pin: CrossLineAnimation;
@ -1230,7 +1205,7 @@ GroupCallLargeVideo {
iconPosition: point; iconPosition: point;
} }
groupCallLargeVideo: GroupCallLargeVideo { groupCallVideoTile: GroupCallVideoTile {
shadowHeight: 40px; shadowHeight: 40px;
namePosition: point(15px, 8px); namePosition: point(15px, 8px);
pin: CrossLineAnimation { pin: CrossLineAnimation {
@ -1246,13 +1221,6 @@ groupCallLargeVideo: GroupCallLargeVideo {
pinTextPosition: point(1px, 3px); pinTextPosition: point(1px, 3px);
iconPosition: point(10px, 5px); iconPosition: point(10px, 5px);
} }
//groupCallLargeVideoListItem: PeerListItem(groupCallMembersListItem) {
// nameFg: groupCallVideoTextFg;
// nameFgChecked: groupCallVideoTextFg;
// statusFg: groupCallVideoSubTextFg;
// statusFgOver: groupCallVideoSubTextFg;
// statusFgActive: groupCallVideoSubTextFg;
//}
groupCallVideoSmallSkip: 4px; groupCallVideoSmallSkip: 4px;
groupCallVideoLargeSkip: 6px; groupCallVideoLargeSkip: 6px;

View file

@ -182,7 +182,7 @@ private:
Ui::CrossLineAnimation _coloredCrossLine; Ui::CrossLineAnimation _coloredCrossLine;
Ui::CrossLineAnimation _inactiveNarrowCrossLine; Ui::CrossLineAnimation _inactiveNarrowCrossLine;
Ui::CrossLineAnimation _coloredNarrowCrossLine; Ui::CrossLineAnimation _coloredNarrowCrossLine;
Ui::CrossLineAnimation _videoLargeCrossLine; Ui::CrossLineAnimation _videoCrossLine;
Ui::RoundRect _narrowRoundRectSelected; Ui::RoundRect _narrowRoundRectSelected;
Ui::RoundRect _narrowRoundRect; Ui::RoundRect _narrowRoundRect;
QImage _narrowShadow; QImage _narrowShadow;
@ -204,7 +204,7 @@ Members::Controller::Controller(
, _coloredCrossLine(st::groupCallMemberColoredCrossLine) , _coloredCrossLine(st::groupCallMemberColoredCrossLine)
, _inactiveNarrowCrossLine(st::groupCallNarrowInactiveCrossLine) , _inactiveNarrowCrossLine(st::groupCallNarrowInactiveCrossLine)
, _coloredNarrowCrossLine(st::groupCallNarrowColoredCrossLine) , _coloredNarrowCrossLine(st::groupCallNarrowColoredCrossLine)
, _videoLargeCrossLine(st::groupCallLargeVideoCrossLine) , _videoCrossLine(st::groupCallVideoCrossLine)
, _narrowRoundRectSelected( , _narrowRoundRectSelected(
ImageRoundRadius::Large, ImageRoundRadius::Large,
st::groupCallMembersBgOver) st::groupCallMembersBgOver)
@ -894,7 +894,8 @@ void Members::Controller::rowPaintIcon(
Painter &p, Painter &p,
QRect rect, QRect rect,
const IconState &state) { const IconState &state) {
if (_mode == PanelMode::Wide && state.style == MembersRowStyle::None) { if (_mode == PanelMode::Wide
&& state.style == MembersRowStyle::Default) {
return; return;
} }
const auto narrow = (state.style == MembersRowStyle::Narrow); const auto narrow = (state.style == MembersRowStyle::Narrow);
@ -906,9 +907,9 @@ void Members::Controller::rowPaintIcon(
st::groupCallMemberInvited.size())); st::groupCallMemberInvited.size()));
return; return;
} }
const auto largeVideo = (state.style == MembersRowStyle::LargeVideo); const auto video = (state.style == MembersRowStyle::Video);
const auto &greenIcon = largeVideo const auto &greenIcon = video
? st::groupCallLargeVideoCrossLine.icon ? st::groupCallVideoCrossLine.icon
: narrow : narrow
? st::groupCallNarrowColoredCrossLine.icon ? st::groupCallNarrowColoredCrossLine.icon
: st::groupCallMemberColoredCrossLine.icon; : st::groupCallMemberColoredCrossLine.icon;
@ -921,8 +922,8 @@ void Members::Controller::rowPaintIcon(
} else if (state.speaking == 0. && (!narrow || !state.mutedByMe)) { } else if (state.speaking == 0. && (!narrow || !state.mutedByMe)) {
if (state.active == 1.) { if (state.active == 1.) {
// Just gray icon, no cross, no coloring. // Just gray icon, no cross, no coloring.
const auto &grayIcon = largeVideo const auto &grayIcon = video
? st::groupCallLargeVideoCrossLine.icon ? st::groupCallVideoCrossLine.icon
: narrow : narrow
? st::groupCallNarrowInactiveCrossLine.icon ? st::groupCallNarrowInactiveCrossLine.icon
: st::groupCallMemberInactiveCrossLine.icon; : st::groupCallMemberInactiveCrossLine.icon;
@ -937,12 +938,12 @@ void Members::Controller::rowPaintIcon(
return; return;
} }
// Red crossed icon, colorized once, cached as last frame. // Red crossed icon, colorized once, cached as last frame.
auto &line = largeVideo auto &line = video
? _videoLargeCrossLine ? _videoCrossLine
: narrow : narrow
? _coloredNarrowCrossLine ? _coloredNarrowCrossLine
: _coloredCrossLine; : _coloredCrossLine;
const auto color = largeVideo const auto color = video
? std::nullopt ? std::nullopt
: std::make_optional(narrow : std::make_optional(narrow
? st::groupCallMemberNotJoinedStatus->c ? st::groupCallMemberNotJoinedStatus->c
@ -956,8 +957,8 @@ void Members::Controller::rowPaintIcon(
return; return;
} else if (state.muted == 0.) { } else if (state.muted == 0.) {
// Gray crossed icon, no coloring, cached as last frame. // Gray crossed icon, no coloring, cached as last frame.
auto &line = largeVideo auto &line = video
? _videoLargeCrossLine ? _videoCrossLine
: narrow : narrow
? _inactiveNarrowCrossLine ? _inactiveNarrowCrossLine
: _inactiveCrossLine; : _inactiveCrossLine;
@ -982,7 +983,7 @@ void Members::Controller::rowPaintIcon(
? st::groupCallMemberNotJoinedStatus ? st::groupCallMemberNotJoinedStatus
: st::groupCallMemberMutedIcon), : st::groupCallMemberMutedIcon),
state.muted); state.muted);
const auto color = largeVideo const auto color = video
? std::nullopt ? std::nullopt
: std::make_optional((narrow && state.mutedByMe) : std::make_optional((narrow && state.mutedByMe)
? st::groupCallMemberMutedIcon->c ? st::groupCallMemberMutedIcon->c
@ -993,8 +994,8 @@ void Members::Controller::rowPaintIcon(
// Don't use caching of the last frame, // Don't use caching of the last frame,
// because 'muted' may animate color. // because 'muted' may animate color.
const auto crossProgress = std::min(1. - state.active, 0.9999); const auto crossProgress = std::min(1. - state.active, 0.9999);
auto &line = largeVideo auto &line = video
? _videoLargeCrossLine ? _videoCrossLine
: narrow : narrow
? _inactiveNarrowCrossLine ? _inactiveNarrowCrossLine
: _inactiveCrossLine; : _inactiveCrossLine;
@ -1410,13 +1411,6 @@ std::unique_ptr<Row> Members::Controller::createRow(
const Data::GroupCallParticipant &participant) { const Data::GroupCallParticipant &participant) {
auto result = std::make_unique<Row>(this, participant.peer); auto result = std::make_unique<Row>(this, participant.peer);
updateRow(result.get(), &participant); updateRow(result.get(), &participant);
//const auto &camera = computeCameraEndpoint(&participant);
//const auto &screen = computeScreenEndpoint(&participant);
//if (!screen.empty() && _largeEndpoint != screen) {
// setRowVideoEndpoint(result.get(), screen);
//} else if (!camera.empty() && _largeEndpoint != camera) {
// setRowVideoEndpoint(result.get(), camera);
//}
return result; return result;
} }
@ -1559,10 +1553,6 @@ void Members::setupAddMember(not_null<GroupCall*> call) {
updateControlsGeometry(); updateControlsGeometry();
} }
rpl::producer<> Members::enlargeVideo() const {
return _enlargeVideoClicks.events();
}
Row *Members::lookupRow(not_null<PeerData*> peer) const { Row *Members::lookupRow(not_null<PeerData*> peer) const {
return _listController->findRow(peer); return _listController->findRow(peer);
} }

View file

@ -55,7 +55,6 @@ public:
[[nodiscard]] rpl::producer<> addMembersRequests() const { [[nodiscard]] rpl::producer<> addMembersRequests() const {
return _addMemberRequests.events(); return _addMemberRequests.events();
} }
[[nodiscard]] rpl::producer<> enlargeVideo() const;
[[nodiscard]] MembersRow *lookupRow(not_null<PeerData*> peer) const; [[nodiscard]] MembersRow *lookupRow(not_null<PeerData*> peer) const;
@ -99,7 +98,6 @@ private:
not_null<Ui::VerticalLayout*> _layout; not_null<Ui::VerticalLayout*> _layout;
const not_null<Ui::RpWidget*> _videoWrap; const not_null<Ui::RpWidget*> _videoWrap;
std::unique_ptr<Viewport> _viewport; std::unique_ptr<Viewport> _viewport;
rpl::event_stream<> _enlargeVideoClicks;
rpl::variable<Ui::RpWidget*> _addMemberButton = nullptr; rpl::variable<Ui::RpWidget*> _addMemberButton = nullptr;
RpWidget *_topSkip = nullptr; RpWidget *_topSkip = nullptr;
RpWidget *_bottomSkip = nullptr; RpWidget *_bottomSkip = nullptr;

View file

@ -581,7 +581,7 @@ void MembersRow::paintStatusText(
availableWidth, availableWidth,
outerWidth, outerWidth,
selected, selected,
MembersRowStyle::None); MembersRowStyle::Default);
} }
void MembersRow::paintComplexStatusText( void MembersRow::paintComplexStatusText(
@ -593,7 +593,7 @@ void MembersRow::paintComplexStatusText(
int outerWidth, int outerWidth,
bool selected, bool selected,
MembersRowStyle style) { MembersRowStyle style) {
const auto skip = (style == MembersRowStyle::None) const auto skip = (style == MembersRowStyle::Default)
? _delegate->rowPaintStatusIcon( ? _delegate->rowPaintStatusIcon(
p, p,
x, x,
@ -606,7 +606,7 @@ void MembersRow::paintComplexStatusText(
x += skip; x += skip;
availableWidth -= skip; availableWidth -= skip;
const auto &font = st::normalFont; const auto &font = st::normalFont;
const auto about = (style == MembersRowStyle::LargeVideo) const auto about = (style == MembersRowStyle::Video)
? QString() ? QString()
: ((_state == State::RaisedHand && !_raisedHandStatus) : ((_state == State::RaisedHand && !_raisedHandStatus)
|| (_state != State::Active && _state != State::RaisedHand)) || (_state != State::Active && _state != State::RaisedHand))
@ -638,7 +638,7 @@ void MembersRow::paintComplexStatusText(
return; return;
} }
p.setFont(font); p.setFont(font);
if (style == MembersRowStyle::LargeVideo) { if (style == MembersRowStyle::Video) {
p.setPen(st::groupCallVideoSubTextFg); p.setPen(st::groupCallVideoSubTextFg);
} else if (_state == State::MutedByMe) { } else if (_state == State::MutedByMe) {
p.setPen(st::groupCallMemberMutedIcon); p.setPen(st::groupCallMemberMutedIcon);

View file

@ -24,9 +24,9 @@ class RippleAnimation;
namespace Calls::Group { namespace Calls::Group {
enum class MembersRowStyle { enum class MembersRowStyle {
None, Default,
Narrow, Narrow,
LargeVideo, Video,
}; };
class MembersRow; class MembersRow;
@ -39,7 +39,7 @@ public:
bool mutedByMe = false; bool mutedByMe = false;
bool raisedHand = false; bool raisedHand = false;
bool invited = false; bool invited = false;
MembersRowStyle style = MembersRowStyle::None; MembersRowStyle style = MembersRowStyle::Default;
}; };
virtual bool rowIsMe(not_null<PeerData*> participantPeer) = 0; virtual bool rowIsMe(not_null<PeerData*> participantPeer) = 0;
virtual bool rowCanMuteMembers() = 0; virtual bool rowCanMuteMembers() = 0;
@ -152,9 +152,9 @@ public:
void paintMuteIcon( void paintMuteIcon(
Painter &p, Painter &p,
QRect iconRect, QRect iconRect,
MembersRowStyle style = MembersRowStyle::None); MembersRowStyle style = MembersRowStyle::Default);
[[nodiscard]] MembersRowDelegate::IconState computeIconState( [[nodiscard]] MembersRowDelegate::IconState computeIconState(
MembersRowStyle style = MembersRowStyle::None) const; MembersRowStyle style = MembersRowStyle::Default) const;
void showContextMenu(); void showContextMenu();

View file

@ -1023,11 +1023,6 @@ void Panel::setupMembers() {
} }
}, _callLifetime); }, _callLifetime);
_members->enlargeVideo(
) | rpl::start_with_next([=] {
enlargeVideo();
}, _callLifetime);
_call->videoEndpointPinnedValue( _call->videoEndpointPinnedValue(
) | rpl::start_with_next([=](const VideoEndpoint &pinned) { ) | rpl::start_with_next([=](const VideoEndpoint &pinned) {
if (pinned && mode() != PanelMode::Wide) { if (pinned && mode() != PanelMode::Wide) {
@ -1134,7 +1129,7 @@ void Panel::setupVideo(not_null<Viewport*> viewport) {
Assert(row != nullptr); Assert(row != nullptr);
viewport->add( viewport->add(
endpoint, endpoint,
LargeVideoTrack{ track.track.get(), row }, VideoTileTrack{ track.track.get(), row },
_call->videoEndpointPinnedValue() | rpl::map(_1 == endpoint)); _call->videoEndpointPinnedValue() | rpl::map(_1 == endpoint));
}; };
for (const auto &[endpoint, track] : _call->activeVideoTracks()) { for (const auto &[endpoint, track] : _call->activeVideoTracks()) {
@ -1167,8 +1162,8 @@ void Panel::setupVideo(not_null<Viewport*> viewport) {
viewport->clicks( viewport->clicks(
) | rpl::filter([=] { ) | rpl::filter([=] {
return (_mode.current() == PanelMode::Default); return (_mode.current() == PanelMode::Default);
}) | rpl::start_with_next([=] { }) | rpl::start_with_next([=](VideoEndpoint &&endpoint) {
enlargeVideo(); _call->pinVideoEndpoint(std::move(endpoint));
}, viewport->lifetime()); }, viewport->lifetime());
viewport->qualityRequests( viewport->qualityRequests(

View file

@ -203,7 +203,7 @@ void Viewport::setControlsShown(float64 shown) {
void Viewport::add( void Viewport::add(
const VideoEndpoint &endpoint, const VideoEndpoint &endpoint,
LargeVideoTrack track, VideoTileTrack track,
rpl::producer<bool> pinned) { rpl::producer<bool> pinned) {
_tiles.push_back(std::make_unique<VideoTile>( _tiles.push_back(std::make_unique<VideoTile>(
endpoint, endpoint,

View file

@ -9,10 +9,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/rp_widget.h" #include "ui/rp_widget.h"
namespace style {
struct GroupCallLargeVideo;
} // namespace style
namespace Ui { namespace Ui {
class AbstractButton; class AbstractButton;
class RpWidgetWrap; class RpWidgetWrap;
@ -39,7 +35,7 @@ class MembersRow;
enum class PanelMode; enum class PanelMode;
enum class VideoQuality; enum class VideoQuality;
struct LargeVideoTrack { struct VideoTileTrack {
Webrtc::VideoTrack *track = nullptr; Webrtc::VideoTrack *track = nullptr;
MembersRow *row = nullptr; MembersRow *row = nullptr;
@ -49,14 +45,14 @@ struct LargeVideoTrack {
}; };
[[nodiscard]] inline bool operator==( [[nodiscard]] inline bool operator==(
LargeVideoTrack a, VideoTileTrack a,
LargeVideoTrack b) noexcept { VideoTileTrack b) noexcept {
return (a.track == b.track) && (a.row == b.row); return (a.track == b.track) && (a.row == b.row);
} }
[[nodiscard]] inline bool operator!=( [[nodiscard]] inline bool operator!=(
LargeVideoTrack a, VideoTileTrack a,
LargeVideoTrack b) noexcept { VideoTileTrack b) noexcept {
return !(a == b); return !(a == b);
} }
@ -76,7 +72,7 @@ public:
void add( void add(
const VideoEndpoint &endpoint, const VideoEndpoint &endpoint,
LargeVideoTrack track, VideoTileTrack track,
rpl::producer<bool> pinned); rpl::producer<bool> pinned);
void remove(const VideoEndpoint &endpoint); void remove(const VideoEndpoint &endpoint);
void showLarge(const VideoEndpoint &endpoint); void showLarge(const VideoEndpoint &endpoint);

View file

@ -240,12 +240,12 @@ void FillTexturedRectangle(
Viewport::RendererGL::RendererGL(not_null<Viewport*> owner) Viewport::RendererGL::RendererGL(not_null<Viewport*> owner)
: _owner(owner) : _owner(owner)
, _pinIcon(st::groupCallLargeVideo.pin) , _pinIcon(st::groupCallVideoTile.pin)
, _muteIcon(st::groupCallLargeVideoCrossLine) , _muteIcon(st::groupCallVideoCrossLine)
, _pinBackground( , _pinBackground(
(st::groupCallLargeVideo.pinPadding.top() (st::groupCallVideoTile.pinPadding.top()
+ st::groupCallLargeVideo.pin.icon.height() + st::groupCallVideoTile.pin.icon.height()
+ st::groupCallLargeVideo.pinPadding.bottom()) / 2, + st::groupCallVideoTile.pinPadding.bottom()) / 2,
st::radialBg) { st::radialBg) {
style::PaletteChanged( style::PaletteChanged(
@ -437,12 +437,12 @@ void Viewport::RendererGL::paintTile(
const auto y = geometry.y(); const auto y = geometry.y();
const auto width = geometry.width(); const auto width = geometry.width();
const auto height = geometry.height(); const auto height = geometry.height();
const auto &st = st::groupCallLargeVideo; const auto &st = st::groupCallVideoTile;
const auto shown = _owner->_controlsShownRatio; const auto shown = _owner->_controlsShownRatio;
const auto fullNameShift = st.namePosition.y() + st::normalFont->height; const auto fullNameShift = st.namePosition.y() + st::normalFont->height;
const auto nameShift = anim::interpolate(fullNameShift, 0, shown); const auto nameShift = anim::interpolate(fullNameShift, 0, shown);
const auto row = tile->row(); const auto row = tile->row();
const auto style = row->computeIconState(MembersRowStyle::LargeVideo); const auto style = row->computeIconState(MembersRowStyle::Video);
validateOutlineAnimation(tile, tileData); validateOutlineAnimation(tile, tileData);
const auto outline = tileData.outlined.value(tileData.outline ? 1. : 0.); const auto outline = tileData.outlined.value(tileData.outline ? 1. : 0.);
@ -487,7 +487,7 @@ void Viewport::RendererGL::paintTile(
const auto pinRect = transformRect(pin.geometry); const auto pinRect = transformRect(pin.geometry);
// Mute. // Mute.
const auto &icon = st::groupCallLargeVideoCrossLine.icon; const auto &icon = st::groupCallVideoCrossLine.icon;
const auto iconLeft = x + width - st.iconPosition.x() - icon.width(); const auto iconLeft = x + width - st.iconPosition.x() - icon.width();
const auto iconTop = y + (height const auto iconTop = y + (height
- st.iconPosition.y() - st.iconPosition.y()
@ -905,7 +905,7 @@ void Viewport::RendererGL::ensureButtonsImage() {
const auto factor = cIntRetinaFactor(); const auto factor = cIntRetinaFactor();
const auto pinOnSize = VideoTile::PinInnerSize(true); const auto pinOnSize = VideoTile::PinInnerSize(true);
const auto pinOffSize = VideoTile::PinInnerSize(false); const auto pinOffSize = VideoTile::PinInnerSize(false);
const auto muteSize = st::groupCallLargeVideoCrossLine.icon.size(); const auto muteSize = st::groupCallVideoCrossLine.icon.size();
const auto fullSize = QSize( const auto fullSize = QSize(
std::max({ std::max({
@ -961,7 +961,7 @@ void Viewport::RendererGL::ensureButtonsImage() {
void Viewport::RendererGL::validateDatas() { void Viewport::RendererGL::validateDatas() {
const auto &tiles = _owner->_tiles; const auto &tiles = _owner->_tiles;
const auto &st = st::groupCallLargeVideo; const auto &st = st::groupCallVideoTile;
const auto count = int(tiles.size()); const auto count = int(tiles.size());
const auto factor = cIntRetinaFactor(); const auto factor = cIntRetinaFactor();
const auto nameHeight = st::semiboldFont->height * factor; const auto nameHeight = st::semiboldFont->height * factor;
@ -979,7 +979,7 @@ void Viewport::RendererGL::validateDatas() {
const auto row = tiles[i]->row(); const auto row = tiles[i]->row();
const auto hasWidth = tiles[i]->geometry().width() const auto hasWidth = tiles[i]->geometry().width()
- st.iconPosition.x() - st.iconPosition.x()
- st::groupCallLargeVideoCrossLine.icon.width() - st::groupCallVideoCrossLine.icon.width()
- st.namePosition.x(); - st.namePosition.x();
return std::clamp(row->name().maxWidth(), 1, hasWidth) * factor; return std::clamp(row->name().maxWidth(), 1, hasWidth) * factor;
}; };

View file

@ -20,11 +20,11 @@ namespace Calls::Group {
Viewport::Renderer::Renderer(not_null<Viewport*> owner) Viewport::Renderer::Renderer(not_null<Viewport*> owner)
: _owner(owner) : _owner(owner)
, _pinIcon(st::groupCallLargeVideo.pin) , _pinIcon(st::groupCallVideoTile.pin)
, _pinBackground( , _pinBackground(
(st::groupCallLargeVideo.pinPadding.top() (st::groupCallVideoTile.pinPadding.top()
+ st::groupCallLargeVideo.pin.icon.height() + st::groupCallVideoTile.pin.icon.height()
+ st::groupCallLargeVideo.pinPadding.bottom()) / 2, + st::groupCallVideoTile.pinPadding.bottom()) / 2,
st::radialBg) { st::radialBg) {
} }
@ -141,7 +141,7 @@ void Viewport::Renderer::paintTileControls(
return; return;
} }
const auto &st = st::groupCallLargeVideo; const auto &st = st::groupCallVideoTile;
const auto fullShift = st.namePosition.y() + st::normalFont->height; const auto fullShift = st.namePosition.y() + st::normalFont->height;
const auto shift = anim::interpolate(fullShift, 0, shown); const auto shift = anim::interpolate(fullShift, 0, shown);
@ -171,7 +171,7 @@ void Viewport::Renderer::paintTileControls(
row->lazyInitialize(st::groupCallMembersListItem); row->lazyInitialize(st::groupCallMembersListItem);
// Mute. // Mute.
const auto &icon = st::groupCallLargeVideoCrossLine.icon; const auto &icon = st::groupCallVideoCrossLine.icon;
const auto iconLeft = x + width - st.iconPosition.x() - icon.width(); const auto iconLeft = x + width - st.iconPosition.x() - icon.width();
const auto iconTop = y + (height const auto iconTop = y + (height
- st.iconPosition.y() - st.iconPosition.y()
@ -180,7 +180,7 @@ void Viewport::Renderer::paintTileControls(
row->paintMuteIcon( row->paintMuteIcon(
p, p,
{ iconLeft, iconTop, icon.width(), icon.height() }, { iconLeft, iconTop, icon.width(), icon.height() },
MembersRowStyle::LargeVideo); MembersRowStyle::Video);
// Name. // Name.
p.setPen(st::groupCallVideoTextFg); p.setPen(st::groupCallVideoTextFg);

View file

@ -19,7 +19,7 @@ namespace Calls::Group {
Viewport::VideoTile::VideoTile( Viewport::VideoTile::VideoTile(
const VideoEndpoint &endpoint, const VideoEndpoint &endpoint,
LargeVideoTrack track, VideoTileTrack track,
rpl::producer<bool> pinned, rpl::producer<bool> pinned,
Fn<void()> update) Fn<void()> update)
: _endpoint(endpoint) : _endpoint(endpoint)
@ -41,7 +41,7 @@ QRect Viewport::VideoTile::pinOuter() const {
int Viewport::VideoTile::pinSlide() const { int Viewport::VideoTile::pinSlide() const {
return anim::interpolate( return anim::interpolate(
st::groupCallLargeVideo.pinPosition.y() + _pinInner.height(), st::groupCallVideoTile.pinPosition.y() + _pinInner.height(),
0, 0,
_pinShownAnimation.value(_pinShown ? 1. : 0.)); _pinShownAnimation.value(_pinShown ? 1. : 0.));
} }
@ -68,7 +68,10 @@ void Viewport::VideoTile::togglePinShown(bool shown) {
} }
bool Viewport::VideoTile::updateRequestedQuality(VideoQuality quality) { bool Viewport::VideoTile::updateRequestedQuality(VideoQuality quality) {
if (_quality && *_quality == quality) { if (_geometry.isEmpty()) {
_quality = std::nullopt;
return false;
} else if (_quality && *_quality == quality) {
return false; return false;
} }
_quality = quality; _quality = quality;
@ -76,8 +79,8 @@ bool Viewport::VideoTile::updateRequestedQuality(VideoQuality quality) {
} }
QSize Viewport::VideoTile::PinInnerSize(bool pinned) { QSize Viewport::VideoTile::PinInnerSize(bool pinned) {
const auto &st = st::groupCallLargeVideo; const auto &st = st::groupCallVideoTile;
const auto &icon = st::groupCallLargeVideo.pin.icon; const auto &icon = st::groupCallVideoTile.pin.icon;
const auto innerWidth = icon.width() const auto innerWidth = icon.width()
+ st.pinTextPosition.x() + st.pinTextPosition.x()
+ st::semiboldFont->width(pinned + st::semiboldFont->width(pinned
@ -101,7 +104,7 @@ void Viewport::VideoTile::PaintPinButton(
int outerWidth, int outerWidth,
not_null<Ui::RoundRect*> background, not_null<Ui::RoundRect*> background,
not_null<Ui::CrossLineAnimation*> icon) { not_null<Ui::CrossLineAnimation*> icon) {
const auto &st = st::groupCallLargeVideo; const auto &st = st::groupCallVideoTile;
const auto rect = QRect(QPoint(x, y), PinInnerSize(pinned)); const auto rect = QRect(QPoint(x, y), PinInnerSize(pinned));
background->paint(p, rect); background->paint(p, rect);
icon->paint( icon->paint(
@ -113,7 +116,7 @@ void Viewport::VideoTile::PaintPinButton(
p.drawTextLeft( p.drawTextLeft(
(x (x
+ st.pinPadding.left() + st.pinPadding.left()
+ st::groupCallLargeVideo.pin.icon.width() + st::groupCallVideoTile.pin.icon.width()
+ st.pinTextPosition.x()), + st.pinTextPosition.x()),
(y (y
+ st.pinPadding.top() + st.pinPadding.top()
@ -126,7 +129,7 @@ void Viewport::VideoTile::PaintPinButton(
} }
void Viewport::VideoTile::updatePinnedGeometry() { void Viewport::VideoTile::updatePinnedGeometry() {
const auto &st = st::groupCallLargeVideo; const auto &st = st::groupCallVideoTile;
const auto buttonSize = PinInnerSize(_pinned); const auto buttonSize = PinInnerSize(_pinned);
const auto fullWidth = st.pinPosition.x() * 2 + buttonSize.width(); const auto fullWidth = st.pinPosition.x() * 2 + buttonSize.width();
const auto fullHeight = st.pinPosition.y() * 2 + buttonSize.height(); const auto fullHeight = st.pinPosition.y() * 2 + buttonSize.height();

View file

@ -25,7 +25,7 @@ class Viewport::VideoTile final {
public: public:
VideoTile( VideoTile(
const VideoEndpoint &endpoint, const VideoEndpoint &endpoint,
LargeVideoTrack track, VideoTileTrack track,
rpl::producer<bool> pinned, rpl::producer<bool> pinned,
Fn<void()> update); Fn<void()> update);
@ -80,7 +80,7 @@ private:
const VideoEndpoint _endpoint; const VideoEndpoint _endpoint;
const Fn<void()> _update; const Fn<void()> _update;
LargeVideoTrack _track; VideoTileTrack _track;
QRect _geometry; QRect _geometry;
rpl::variable<QSize> _trackSize; rpl::variable<QSize> _trackSize;
QRect _pinOuter; QRect _pinOuter;