2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Allow editing topic title and icon.

This commit is contained in:
John Preston
2022-09-27 16:05:47 +04:00
parent c90f879c96
commit 3b3792ef75
42 changed files with 603 additions and 190 deletions

View File

@@ -1258,9 +1258,7 @@ base::unique_qptr<Ui::PopupMenu> Members::Controller::createRowContextMenu(
result->menu(),
st::groupCallPopupCoverMenu,
st::groupCallMenuCover,
Info::Profile::NameValue(
participantPeer
) | rpl::map([](const auto &text) { return text.text; }),
Info::Profile::NameValue(participantPeer),
PrepareShortInfoStatus(participantPeer),
PrepareShortInfoUserpic(
participantPeer,

View File

@@ -182,10 +182,10 @@ void JoinAsAction::prepare() {
rpl::combine(
tr::lng_group_call_display_as_header(),
Info::Profile::NameValue(_peer)
) | rpl::start_with_next([=](QString text, TextWithEntities name) {
) | rpl::start_with_next([=](QString text, QString name) {
const auto &padding = st::groupCallJoinAsPadding;
_text.setMarkedText(_st.itemStyle, { text }, MenuTextOptions);
_name.setMarkedText(_st.itemStyle, name, MenuTextOptions);
_name.setMarkedText(_st.itemStyle, { name }, MenuTextOptions);
const auto textWidth = _text.maxWidth();
const auto nameWidth = _name.maxWidth();
const auto textLeft = padding.left()

View File

@@ -221,8 +221,8 @@ void Panel::migrate(not_null<ChannelData*> channel) {
void Panel::subscribeToPeerChanges() {
Info::Profile::NameValue(
_peer
) | rpl::start_with_next([=](const TextWithEntities &name) {
window()->setTitle(name.text);
) | rpl::start_with_next([=](const QString &name) {
window()->setTitle(name);
}, _peerLifetime);
}
@@ -2336,10 +2336,8 @@ void Panel::refreshTitle() {
) | rpl::map([=](not_null<Data::GroupCall*> real) {
return real->titleValue();
}) | rpl::flatten_latest())
) | rpl::map([=](
const TextWithEntities &name,
const QString &title) {
return title.isEmpty() ? name.text : title;
) | rpl::map([=](const QString &name, const QString &title) {
return title.isEmpty() ? name : title;
}) | rpl::after_next([=] {
refreshTitleGeometry();
});