mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Use "Change Emoji Status" phrase.
This commit is contained in:
parent
d81b2fbb69
commit
cae18b3320
2 changed files with 20 additions and 3 deletions
|
@ -18,6 +18,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_menu_add_account" = "Add Account";
|
"lng_menu_add_account" = "Add Account";
|
||||||
"lng_menu_activate" = "Activate";
|
"lng_menu_activate" = "Activate";
|
||||||
"lng_menu_set_status" = "Set Emoji Status";
|
"lng_menu_set_status" = "Set Emoji Status";
|
||||||
|
"lng_menu_change_status" = "Change Emoji Status";
|
||||||
|
|
||||||
"lng_disable_notifications_from_tray" = "Disable notifications";
|
"lng_disable_notifications_from_tray" = "Disable notifications";
|
||||||
"lng_enable_notifications_from_tray" = "Enable notifications";
|
"lng_enable_notifications_from_tray" = "Enable notifications";
|
||||||
|
|
|
@ -118,6 +118,24 @@ void ShowCallsBox(not_null<Window::SessionController*> window) {
|
||||||
window->show(Box<PeerListBox>(std::move(controller), initBox));
|
window->show(Box<PeerListBox>(std::move(controller), initBox));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] rpl::producer<TextWithEntities> SetStatusLabel(
|
||||||
|
not_null<Main::Session*> session) {
|
||||||
|
const auto self = session->user();
|
||||||
|
return session->changes().peerFlagsValue(
|
||||||
|
self,
|
||||||
|
Data::PeerUpdate::Flag::EmojiStatus
|
||||||
|
) | rpl::map([=] {
|
||||||
|
return (self->emojiStatusId() != 0);
|
||||||
|
}) | rpl::distinct_until_changed() | rpl::map([](bool has) {
|
||||||
|
const auto makeLink = [](const QString &text) {
|
||||||
|
return Ui::Text::Link(text);
|
||||||
|
};
|
||||||
|
return (has
|
||||||
|
? tr::lng_menu_change_status
|
||||||
|
: tr::lng_menu_set_status)(makeLink);
|
||||||
|
}) | rpl::flatten_latest();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
class MainMenu::ToggleAccountsButton final : public Ui::AbstractButton {
|
class MainMenu::ToggleAccountsButton final : public Ui::AbstractButton {
|
||||||
|
@ -340,9 +358,7 @@ MainMenu::MainMenu(
|
||||||
Ui::UserpicButton::Role::Custom,
|
Ui::UserpicButton::Role::Custom,
|
||||||
st::mainMenuUserpic)
|
st::mainMenuUserpic)
|
||||||
, _toggleAccounts(this)
|
, _toggleAccounts(this)
|
||||||
, _setEmojiStatus(this, tr::lng_menu_set_status([](const QString &text) {
|
, _setEmojiStatus(this, SetStatusLabel(&controller->session()))
|
||||||
return Ui::Text::Link(text);
|
|
||||||
}))
|
|
||||||
, _emojiStatusPanel(std::make_unique<Info::Profile::EmojiStatusPanel>())
|
, _emojiStatusPanel(std::make_unique<Info::Profile::EmojiStatusPanel>())
|
||||||
, _badge(std::make_unique<Info::Profile::Badge>(
|
, _badge(std::make_unique<Info::Profile::Badge>(
|
||||||
this,
|
this,
|
||||||
|
|
Loading…
Add table
Reference in a new issue