mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Added discuss button to action buttons in profile top bar.
This commit is contained in:
@@ -1674,6 +1674,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||||||
"lng_profile_action_short_mute" = "Mute";
|
"lng_profile_action_short_mute" = "Mute";
|
||||||
"lng_profile_action_short_unmute" = "Unmute";
|
"lng_profile_action_short_unmute" = "Unmute";
|
||||||
"lng_profile_action_short_call" = "Call";
|
"lng_profile_action_short_call" = "Call";
|
||||||
|
"lng_profile_action_short_discuss" = "Discuss";
|
||||||
|
|
||||||
"lng_media_type_photos" = "Photos";
|
"lng_media_type_photos" = "Photos";
|
||||||
"lng_media_type_gifs" = "GIFs";
|
"lng_media_type_gifs" = "GIFs";
|
||||||
|
|||||||
@@ -493,6 +493,25 @@ void TopBar::setupActions(not_null<Controller*> controller) {
|
|||||||
user->updateFull();
|
user->updateFull();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (const auto chat = channel ? channel->discussionLink() : nullptr) {
|
||||||
|
const auto navigation = controller->parentController();
|
||||||
|
const auto discuss = Ui::CreateChild<TopBarActionButton>(
|
||||||
|
this,
|
||||||
|
tr::lng_profile_action_short_discuss(tr::now),
|
||||||
|
st::infoProfileTopBarActionMessage);
|
||||||
|
discuss->setClickedCallback([=] {
|
||||||
|
if (channel->invitePeekExpires()) {
|
||||||
|
controller->showToast(
|
||||||
|
tr::lng_channel_invite_private(tr::now));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
navigation->showPeerHistory(
|
||||||
|
chat,
|
||||||
|
Window::SectionShow::Way::Forward);
|
||||||
|
});
|
||||||
|
_actions->add(discuss);
|
||||||
|
buttons.push_back(discuss);
|
||||||
|
}
|
||||||
_edgeColor.value() | rpl::map(mapped) | rpl::start_with_next([=](
|
_edgeColor.value() | rpl::map(mapped) | rpl::start_with_next([=](
|
||||||
QColor c) {
|
QColor c) {
|
||||||
for (const auto &button : buttons) {
|
for (const auto &button : buttons) {
|
||||||
|
|||||||
Reference in New Issue
Block a user