mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Move 'Invite members' button to the bottom.
This commit is contained in:
parent
0e49bf5dee
commit
8a693bc932
4 changed files with 26 additions and 12 deletions
|
@ -867,6 +867,7 @@ groupCallControlsBackRadius: 12px;
|
||||||
groupCallMuteBottomSkip: 116px;
|
groupCallMuteBottomSkip: 116px;
|
||||||
|
|
||||||
groupCallMembersMargin: margins(16px, 16px, 16px, 60px);
|
groupCallMembersMargin: margins(16px, 16px, 16px, 60px);
|
||||||
|
groupCallMembersTopSkip: 6px;
|
||||||
groupCallMembersBottomSkip: 80px;
|
groupCallMembersBottomSkip: 80px;
|
||||||
groupCallMembersShadowHeight: 160px;
|
groupCallMembersShadowHeight: 160px;
|
||||||
groupCallMembersFadeSkip: 10px;
|
groupCallMembersFadeSkip: 10px;
|
||||||
|
|
|
@ -1658,8 +1658,8 @@ Members::Members(
|
||||||
std::make_unique<Viewport>(
|
std::make_unique<Viewport>(
|
||||||
_videoWrap.get(),
|
_videoWrap.get(),
|
||||||
PanelMode::Default)) {
|
PanelMode::Default)) {
|
||||||
setupAddMember(call);
|
|
||||||
setupList();
|
setupList();
|
||||||
|
setupAddMember(call);
|
||||||
setContent(_list);
|
setContent(_list);
|
||||||
setupFakeRoundCorners();
|
setupFakeRoundCorners();
|
||||||
_listController->setDelegate(static_cast<PeerListDelegate*>(this));
|
_listController->setDelegate(static_cast<PeerListDelegate*>(this));
|
||||||
|
@ -1796,8 +1796,10 @@ void Members::setupAddMember(not_null<GroupCall*> call) {
|
||||||
wrap->resizeToWidth(_layout->width());
|
wrap->resizeToWidth(_layout->width());
|
||||||
delete _addMemberButton.current();
|
delete _addMemberButton.current();
|
||||||
_addMemberButton = wrap.data();
|
_addMemberButton = wrap.data();
|
||||||
_layout->insert(1, std::move(wrap));
|
_layout->insert(3, std::move(wrap));
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
|
|
||||||
|
updateControlsGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<> Members::enlargeVideo() const {
|
rpl::producer<> Members::enlargeVideo() const {
|
||||||
|
@ -1826,7 +1828,7 @@ QRect Members::getInnerGeometry() const {
|
||||||
0,
|
0,
|
||||||
-_scroll->scrollTop(),
|
-_scroll->scrollTop(),
|
||||||
width(),
|
width(),
|
||||||
_list->y() + _list->height());
|
_list->y() + _list->height() + add);
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<int> Members::fullCountValue() const {
|
rpl::producer<int> Members::fullCountValue() const {
|
||||||
|
@ -1835,9 +1837,18 @@ rpl::producer<int> Members::fullCountValue() const {
|
||||||
|
|
||||||
void Members::setupList() {
|
void Members::setupList() {
|
||||||
_listController->setStyleOverrides(&st::groupCallMembersList);
|
_listController->setStyleOverrides(&st::groupCallMembersList);
|
||||||
_list = _layout->add(object_ptr<ListWidget>(
|
_topSkip = _layout->add(
|
||||||
_layout.get(),
|
object_ptr<Ui::FixedHeightWidget>(
|
||||||
_listController.get()));
|
_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<ListWidget>(
|
||||||
|
_layout.get(),
|
||||||
|
_listController.get()));
|
||||||
const auto skip = _layout->add(object_ptr<Ui::RpWidget>(_layout.get()));
|
const auto skip = _layout->add(object_ptr<Ui::RpWidget>(_layout.get()));
|
||||||
_mode.value(
|
_mode.value(
|
||||||
) | rpl::start_with_next([=](PanelMode mode) {
|
) | rpl::start_with_next([=](PanelMode mode) {
|
||||||
|
@ -1859,8 +1870,6 @@ void Members::setupList() {
|
||||||
) | rpl::start_with_next([=](int scrollTop, int scrollHeight) {
|
) | rpl::start_with_next([=](int scrollTop, int scrollHeight) {
|
||||||
_layout->setVisibleTopBottom(scrollTop, scrollTop + scrollHeight);
|
_layout->setVisibleTopBottom(scrollTop, scrollTop + scrollHeight);
|
||||||
}, _scroll->lifetime());
|
}, _scroll->lifetime());
|
||||||
|
|
||||||
updateControlsGeometry();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Members::trackViewportGeometry() {
|
void Members::trackViewportGeometry() {
|
||||||
|
@ -1983,9 +1992,13 @@ void Members::setupFakeRoundCorners() {
|
||||||
}) | rpl::flatten_latest()
|
}) | rpl::flatten_latest()
|
||||||
) | rpl::start_with_next([=](QRect list, int addMembers) {
|
) | rpl::start_with_next([=](QRect list, int addMembers) {
|
||||||
const auto left = list.x();
|
const auto left = list.x();
|
||||||
const auto top = list.y() - addMembers;
|
const auto top = list.y() - _topSkip->height();
|
||||||
const auto right = list.x() + list.width() - topright->width();
|
const auto right = left + list.width() - topright->width();
|
||||||
const auto bottom = list.y() + list.height() - bottomleft->height();
|
const auto bottom = top
|
||||||
|
+ _topSkip->height()
|
||||||
|
+ list.height()
|
||||||
|
+ addMembers
|
||||||
|
- bottomleft->height();
|
||||||
topleft->move(left, top);
|
topleft->move(left, top);
|
||||||
topright->move(right, top);
|
topright->move(right, top);
|
||||||
bottomleft->move(left, bottom);
|
bottomleft->move(left, bottom);
|
||||||
|
|
|
@ -101,6 +101,7 @@ private:
|
||||||
std::unique_ptr<Viewport> _viewport;
|
std::unique_ptr<Viewport> _viewport;
|
||||||
rpl::event_stream<> _enlargeVideoClicks;
|
rpl::event_stream<> _enlargeVideoClicks;
|
||||||
rpl::variable<Ui::RpWidget*> _addMemberButton = nullptr;
|
rpl::variable<Ui::RpWidget*> _addMemberButton = nullptr;
|
||||||
|
RpWidget *_topSkip = nullptr;
|
||||||
ListWidget *_list = nullptr;
|
ListWidget *_list = nullptr;
|
||||||
rpl::event_stream<> _addMemberRequests;
|
rpl::event_stream<> _addMemberRequests;
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,6 @@ void Viewport::Renderer::paintTileControls(
|
||||||
MembersRowStyle::LargeVideo);
|
MembersRowStyle::LargeVideo);
|
||||||
|
|
||||||
// Name.
|
// Name.
|
||||||
row->lazyInitialize(st::groupCallMembersListItem);
|
|
||||||
p.setPen(st::groupCallVideoTextFg);
|
p.setPen(st::groupCallVideoTextFg);
|
||||||
const auto hasWidth = width
|
const auto hasWidth = width
|
||||||
- st.iconPosition.x() - icon.width()
|
- st.iconPosition.x() - icon.width()
|
||||||
|
|
Loading…
Add table
Reference in a new issue