init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
92
Telegram/SourceFiles/calls/group/calls_cover_item.cpp
Normal file
92
Telegram/SourceFiles/calls/group/calls_cover_item.cpp
Normal file
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#include "calls/group/calls_cover_item.h"
|
||||
|
||||
#include "boxes/peers/prepare_short_info_box.h"
|
||||
#include "styles/style_calls.h"
|
||||
#include "styles/style_info.h"
|
||||
|
||||
namespace Calls {
|
||||
|
||||
CoverItem::CoverItem(
|
||||
not_null<RpWidget*> parent,
|
||||
const style::Menu &stMenu,
|
||||
const style::ShortInfoCover &st,
|
||||
rpl::producer<QString> name,
|
||||
rpl::producer<QString> status,
|
||||
PreparedShortInfoUserpic userpic)
|
||||
: Ui::Menu::ItemBase(parent, stMenu)
|
||||
, _cover(
|
||||
this,
|
||||
st,
|
||||
std::move(name),
|
||||
std::move(status),
|
||||
std::move(userpic.value),
|
||||
[] { return false; })
|
||||
, _dummyAction(new QAction(parent))
|
||||
, _st(st) {
|
||||
setPointerCursor(false);
|
||||
|
||||
initResizeHook(parent->sizeValue());
|
||||
enableMouseSelecting();
|
||||
enableMouseSelecting(_cover.widget());
|
||||
|
||||
_cover.widget()->move(0, 0);
|
||||
_cover.moveRequests(
|
||||
) | rpl::on_next(userpic.move, lifetime());
|
||||
}
|
||||
|
||||
not_null<QAction*> CoverItem::action() const {
|
||||
return _dummyAction;
|
||||
}
|
||||
|
||||
bool CoverItem::isEnabled() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
int CoverItem::contentHeight() const {
|
||||
return _st.size + st::groupCallMenu.separator.padding.bottom();
|
||||
}
|
||||
|
||||
AboutItem::AboutItem(
|
||||
not_null<RpWidget*> parent,
|
||||
const style::Menu &st,
|
||||
TextWithEntities &&about)
|
||||
: Ui::Menu::ItemBase(parent, st)
|
||||
, _st(st)
|
||||
, _text(base::make_unique_q<Ui::FlatLabel>(
|
||||
this,
|
||||
rpl::single(std::move(about)),
|
||||
st::groupCallMenuAbout))
|
||||
, _dummyAction(new QAction(parent)) {
|
||||
setPointerCursor(false);
|
||||
|
||||
initResizeHook(parent->sizeValue());
|
||||
enableMouseSelecting();
|
||||
enableMouseSelecting(_text.get());
|
||||
|
||||
_text->setSelectable(true);
|
||||
_text->resizeToWidth(st::groupCallMenuAbout.minWidth);
|
||||
_text->moveToLeft(st.itemPadding.left(), st.itemPadding.top());
|
||||
}
|
||||
|
||||
not_null<QAction*> AboutItem::action() const {
|
||||
return _dummyAction;
|
||||
}
|
||||
|
||||
bool AboutItem::isEnabled() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
int AboutItem::contentHeight() const {
|
||||
return _st.itemPadding.top()
|
||||
+ _text->height()
|
||||
+ _st.itemPadding.bottom();
|
||||
}
|
||||
|
||||
} // namespace Calls
|
||||
Reference in New Issue
Block a user