diff --git a/Telegram/SourceFiles/calls/calls.style b/Telegram/SourceFiles/calls/calls.style index 47d636dc2..d16acedb9 100644 --- a/Telegram/SourceFiles/calls/calls.style +++ b/Telegram/SourceFiles/calls/calls.style @@ -867,6 +867,7 @@ groupCallControlsBackRadius: 12px; groupCallMuteBottomSkip: 116px; groupCallMembersMargin: margins(16px, 16px, 16px, 60px); +groupCallMembersTopSkip: 6px; groupCallMembersBottomSkip: 80px; groupCallMembersShadowHeight: 160px; groupCallMembersFadeSkip: 10px; diff --git a/Telegram/SourceFiles/calls/group/calls_group_members.cpp b/Telegram/SourceFiles/calls/group/calls_group_members.cpp index e9d1a7b87..92b23ae91 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_members.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_members.cpp @@ -1658,8 +1658,8 @@ Members::Members( std::make_unique( _videoWrap.get(), PanelMode::Default)) { - setupAddMember(call); setupList(); + setupAddMember(call); setContent(_list); setupFakeRoundCorners(); _listController->setDelegate(static_cast(this)); @@ -1796,8 +1796,10 @@ void Members::setupAddMember(not_null call) { wrap->resizeToWidth(_layout->width()); delete _addMemberButton.current(); _addMemberButton = wrap.data(); - _layout->insert(1, std::move(wrap)); + _layout->insert(3, std::move(wrap)); }, lifetime()); + + updateControlsGeometry(); } rpl::producer<> Members::enlargeVideo() const { @@ -1826,7 +1828,7 @@ QRect Members::getInnerGeometry() const { 0, -_scroll->scrollTop(), width(), - _list->y() + _list->height()); + _list->y() + _list->height() + add); } rpl::producer Members::fullCountValue() const { @@ -1835,9 +1837,18 @@ rpl::producer Members::fullCountValue() const { void Members::setupList() { _listController->setStyleOverrides(&st::groupCallMembersList); - _list = _layout->add(object_ptr( - _layout.get(), - _listController.get())); + _topSkip = _layout->add( + object_ptr( + _layout.get(), + st::groupCallMembersTopSkip)); + _topSkip->paintRequest( + ) | rpl::start_with_next([=](QRect clip) { + QPainter(_topSkip).fillRect(clip, st::groupCallMembersBg); + }, _topSkip->lifetime()); + _list = _layout->add( + object_ptr( + _layout.get(), + _listController.get())); const auto skip = _layout->add(object_ptr(_layout.get())); _mode.value( ) | rpl::start_with_next([=](PanelMode mode) { @@ -1859,8 +1870,6 @@ void Members::setupList() { ) | rpl::start_with_next([=](int scrollTop, int scrollHeight) { _layout->setVisibleTopBottom(scrollTop, scrollTop + scrollHeight); }, _scroll->lifetime()); - - updateControlsGeometry(); } void Members::trackViewportGeometry() { @@ -1983,9 +1992,13 @@ void Members::setupFakeRoundCorners() { }) | rpl::flatten_latest() ) | rpl::start_with_next([=](QRect list, int addMembers) { const auto left = list.x(); - const auto top = list.y() - addMembers; - const auto right = list.x() + list.width() - topright->width(); - const auto bottom = list.y() + list.height() - bottomleft->height(); + const auto top = list.y() - _topSkip->height(); + const auto right = left + list.width() - topright->width(); + const auto bottom = top + + _topSkip->height() + + list.height() + + addMembers + - bottomleft->height(); topleft->move(left, top); topright->move(right, top); bottomleft->move(left, bottom); diff --git a/Telegram/SourceFiles/calls/group/calls_group_members.h b/Telegram/SourceFiles/calls/group/calls_group_members.h index f221cdb0f..737085b63 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_members.h +++ b/Telegram/SourceFiles/calls/group/calls_group_members.h @@ -101,6 +101,7 @@ private: std::unique_ptr _viewport; rpl::event_stream<> _enlargeVideoClicks; rpl::variable _addMemberButton = nullptr; + RpWidget *_topSkip = nullptr; ListWidget *_list = nullptr; rpl::event_stream<> _addMemberRequests; diff --git a/Telegram/SourceFiles/calls/group/calls_group_viewport_raster.cpp b/Telegram/SourceFiles/calls/group/calls_group_viewport_raster.cpp index 8236bc2af..8860bcadc 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_viewport_raster.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_viewport_raster.cpp @@ -183,7 +183,6 @@ void Viewport::Renderer::paintTileControls( MembersRowStyle::LargeVideo); // Name. - row->lazyInitialize(st::groupCallMembersListItem); p.setPen(st::groupCallVideoTextFg); const auto hasWidth = width - st.iconPosition.x() - icon.width()