mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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 "tray.h"
|
||||||
#include "lang_auto.h"
|
#include "lang_auto.h"
|
||||||
|
|
||||||
|
// AyuGram includes
|
||||||
|
#include "ayu/ui/settings/settings_ayu.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Window {
|
namespace Window {
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -216,20 +219,9 @@ void ShowCallsBox(not_null<Window::SessionController*> window) {
|
||||||
|
|
||||||
[[nodiscard]] rpl::producer<TextWithEntities> SetStatusLabel(
|
[[nodiscard]] rpl::producer<TextWithEntities> SetStatusLabel(
|
||||||
not_null<Main::Session*> session) {
|
not_null<Main::Session*> session) {
|
||||||
const auto self = session->user();
|
return tr::ayu_AyuPreferences() | rpl::map([](const QString& text) {
|
||||||
return session->changes().peerFlagsValue(
|
return Ui::Text::Link(text);
|
||||||
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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupMenuBots(
|
void SetupMenuBots(
|
||||||
|
@ -838,7 +830,7 @@ void MainMenu::setupAccountsToggle() {
|
||||||
|
|
||||||
void MainMenu::setupSetEmojiStatus() {
|
void MainMenu::setupSetEmojiStatus() {
|
||||||
_setEmojiStatus->overrideLinkClickHandler([=] {
|
_setEmojiStatus->overrideLinkClickHandler([=] {
|
||||||
chooseEmojiStatus();
|
_controller->showSettings(Settings::Ayu::Id());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue