mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 13:17:08 +02:00
feat: quick access to preferences
It's label useless so why not just replace with custom preferences.
This commit is contained in:
parent
9c71aba5d1
commit
c4cf4325d6
1 changed files with 7 additions and 15 deletions
|
@ -82,6 +82,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "tray.h"
|
||||
#include "lang_auto.h"
|
||||
|
||||
// AyuGram includes
|
||||
#include "ayu/ui/settings/settings_ayu.h"
|
||||
|
||||
|
||||
namespace Window {
|
||||
namespace {
|
||||
|
@ -216,20 +219,9 @@ void ShowCallsBox(not_null<Window::SessionController*> window) {
|
|||
|
||||
[[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();
|
||||
return tr::ayu_AyuPreferences() | rpl::map([](const QString& text) {
|
||||
return Ui::Text::Link(text);
|
||||
});
|
||||
}
|
||||
|
||||
void SetupMenuBots(
|
||||
|
@ -838,7 +830,7 @@ void MainMenu::setupAccountsToggle() {
|
|||
|
||||
void MainMenu::setupSetEmojiStatus() {
|
||||
_setEmojiStatus->overrideLinkClickHandler([=] {
|
||||
chooseEmojiStatus();
|
||||
_controller->showSettings(Settings::Ayu::Id());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue