mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
feat: import peer ID view from Kotato
fix: really update string views in AyuGram Preferences
This commit is contained in:
parent
e21ccd6024
commit
09e24083ff
11 changed files with 237 additions and 51 deletions
|
@ -120,6 +120,8 @@ PRIVATE
|
|||
ayu/database/entities.h
|
||||
ayu/database/ayu_database.cpp
|
||||
ayu/database/ayu_database.h
|
||||
ayu/utils/ayu_profile_values.cpp
|
||||
ayu/utils/ayu_profile_values.h
|
||||
|
||||
api/api_attached_stickers.cpp
|
||||
api/api_attached_stickers.h
|
||||
|
|
|
@ -3875,4 +3875,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
"ayu_EditsHistoryMenuText" = "History";
|
||||
"ayu_ReadUntilMenuText" = "Read until";
|
||||
"ayu_LikelyOfflineStatus" = "offline ?";
|
||||
"ayu_GhostModeShortcut" = "Enter with Ghost";
|
||||
"ayu_SettingsWatermark" = "AyuGram developed and maintained by Radolyn Labs";
|
||||
"ayu_SettingsShowID" = "Show peer ID";
|
||||
"ayu_SettingsShowID_Hide" = "Hide";
|
||||
"ayu_ContextCopyID" = "Copy ID";
|
||||
"ayu_IDCopiedToast" = "ID copied to clipboard.";
|
||||
"ayu_DrawerGhostModeToggle" = "Ghost Mode";
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "ayu_settings.h"
|
||||
#include "rpl/lifetime.h"
|
||||
#include "rpl/producer.h"
|
||||
#include "rpl/variable.h"
|
||||
|
||||
namespace AyuSettings {
|
||||
const QString filename = "tdata/ayu_settings.json";
|
||||
|
@ -14,6 +16,8 @@ namespace AyuSettings {
|
|||
rpl::variable<bool> keepMessagesHistoryReactive;
|
||||
rpl::variable<QString> deletedMarkReactive;
|
||||
rpl::variable<QString> editedMarkReactive;
|
||||
rpl::variable<int> showPeerIdReactive;
|
||||
|
||||
rpl::variable<bool> ghostModeEnabled;
|
||||
|
||||
rpl::lifetime lifetime = rpl::lifetime();
|
||||
|
@ -47,6 +51,8 @@ namespace AyuSettings {
|
|||
keepMessagesHistoryReactive = settings->keepMessagesHistory;
|
||||
deletedMarkReactive = settings->deletedMark;
|
||||
editedMarkReactive = settings->editedMark;
|
||||
showPeerIdReactive = settings->showPeerId;
|
||||
|
||||
ghostModeEnabled = !settings->sendReadPackets && !settings->sendOnlinePackets;
|
||||
}
|
||||
|
||||
|
@ -127,43 +133,52 @@ namespace AyuSettings {
|
|||
editedMarkReactive = editedMark;
|
||||
}
|
||||
|
||||
rpl::variable<bool> get_sendReadPacketsReactive() {
|
||||
return sendReadPacketsReactive;
|
||||
void AyuGramSettings::set_showPeerId(int val) {
|
||||
showPeerId = val;
|
||||
showPeerIdReactive = val;
|
||||
}
|
||||
|
||||
rpl::variable<bool> get_sendOnlinePacketsReactive() {
|
||||
return sendOnlinePacketsReactive;
|
||||
rpl::producer<bool> get_sendReadPacketsReactive() {
|
||||
return sendReadPacketsReactive.value();
|
||||
}
|
||||
|
||||
rpl::variable<bool> get_sendOfflinePacketAfterOnlineReactive() {
|
||||
return sendOfflinePacketAfterOnlineReactive;
|
||||
rpl::producer<bool> get_sendOnlinePacketsReactive() {
|
||||
return sendOnlinePacketsReactive.value();
|
||||
}
|
||||
|
||||
rpl::variable<bool> get_sendUploadProgressReactive() {
|
||||
return sendUploadProgressReactive;
|
||||
rpl::producer<bool> get_sendOfflinePacketAfterOnlineReactive() {
|
||||
return sendOfflinePacketAfterOnlineReactive.value();
|
||||
}
|
||||
|
||||
rpl::variable<bool> get_useScheduledMessagesReactive() {
|
||||
return useScheduledMessagesReactive;
|
||||
rpl::producer<bool> get_sendUploadProgressReactive() {
|
||||
return sendUploadProgressReactive.value();
|
||||
}
|
||||
|
||||
rpl::variable<bool> get_keepDeletedMessagesReactive() {
|
||||
return keepDeletedMessagesReactive;
|
||||
rpl::producer<bool> get_useScheduledMessagesReactive() {
|
||||
return useScheduledMessagesReactive.value();
|
||||
}
|
||||
|
||||
rpl::variable<bool> get_keepMessagesHistoryReactive() {
|
||||
return keepMessagesHistoryReactive;
|
||||
rpl::producer<bool> get_keepDeletedMessagesReactive() {
|
||||
return keepDeletedMessagesReactive.value();
|
||||
}
|
||||
|
||||
rpl::variable<QString> get_deletedMarkReactive() {
|
||||
return deletedMarkReactive;
|
||||
rpl::producer<bool> get_keepMessagesHistoryReactive() {
|
||||
return keepMessagesHistoryReactive.value();
|
||||
}
|
||||
|
||||
rpl::variable<QString> get_editedMarkReactive() {
|
||||
return editedMarkReactive;
|
||||
rpl::producer<QString> get_deletedMarkReactive() {
|
||||
return deletedMarkReactive.value();
|
||||
}
|
||||
|
||||
rpl::variable<bool> get_ghostModeEnabled() {
|
||||
return ghostModeEnabled;
|
||||
rpl::producer<QString> get_editedMarkReactive() {
|
||||
return editedMarkReactive.value();
|
||||
}
|
||||
|
||||
rpl::producer<int> get_showPeerId() {
|
||||
return showPeerIdReactive.value();
|
||||
}
|
||||
|
||||
rpl::producer<bool> get_ghostModeEnabled() {
|
||||
return ghostModeEnabled.value();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,13 @@ namespace AyuSettings {
|
|||
keepMessagesHistory = false;
|
||||
deletedMark = "🧹";
|
||||
editedMark = tr::lng_edited(tr::now);
|
||||
|
||||
/*
|
||||
* showPeerId = 0 means no ID shown
|
||||
* showPeerId = 1 means ID shown as for Telegram API devs
|
||||
* showPeerId = 2 means ID shown as for Bot API devs (-100)
|
||||
*/
|
||||
showPeerId = 2;
|
||||
}
|
||||
|
||||
QS_SERIALIZABLE
|
||||
|
@ -44,6 +51,8 @@ namespace AyuSettings {
|
|||
|
||||
QS_FIELD(QString, editedMark)
|
||||
|
||||
QS_FIELD(int, showPeerId)
|
||||
|
||||
public:
|
||||
void set_sendReadPackets(bool val);
|
||||
void set_sendOnlinePackets(bool val);
|
||||
|
@ -54,6 +63,7 @@ namespace AyuSettings {
|
|||
void set_keepMessagesHistory(bool val);
|
||||
void set_deletedMark(QString val);
|
||||
void set_editedMark(QString val);
|
||||
void set_showPeerId(int val);
|
||||
};
|
||||
|
||||
AyuGramSettings &getInstance();
|
||||
|
@ -62,16 +72,17 @@ namespace AyuSettings {
|
|||
|
||||
void save();
|
||||
|
||||
rpl::variable<bool> get_sendReadPacketsReactive();
|
||||
rpl::variable<bool> get_sendOnlinePacketsReactive();
|
||||
rpl::variable<bool> get_sendOfflinePacketAfterOnlineReactive();
|
||||
rpl::variable<bool> get_sendUploadProgressReactive();
|
||||
rpl::variable<bool> get_useScheduledMessagesReactive();
|
||||
rpl::variable<bool> get_keepDeletedMessagesReactive();
|
||||
rpl::variable<bool> get_keepMessagesHistoryReactive();
|
||||
rpl::variable<QString> get_deletedMarkReactive();
|
||||
rpl::variable<QString> get_editedMarkReactive();
|
||||
rpl::producer<bool> get_sendReadPacketsReactive();
|
||||
rpl::producer<bool> get_sendOnlinePacketsReactive();
|
||||
rpl::producer<bool> get_sendOfflinePacketAfterOnlineReactive();
|
||||
rpl::producer<bool> get_sendUploadProgressReactive();
|
||||
rpl::producer<bool> get_useScheduledMessagesReactive();
|
||||
rpl::producer<bool> get_keepDeletedMessagesReactive();
|
||||
rpl::producer<bool> get_keepMessagesHistoryReactive();
|
||||
rpl::producer<QString> get_deletedMarkReactive();
|
||||
rpl::producer<QString> get_editedMarkReactive();
|
||||
rpl::producer<int> get_showPeerId();
|
||||
|
||||
// computed fields
|
||||
rpl::variable<bool> get_ghostModeEnabled();
|
||||
rpl::producer<bool> get_ghostModeEnabled();
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#include <ui/boxes/single_choice_box.h>
|
||||
#include "ayu/boxes/edit_edited_mark.h"
|
||||
#include "ayu/boxes/edit_deleted_mark.h"
|
||||
#include "ayu/ayu_settings.h"
|
||||
|
@ -35,10 +36,9 @@ namespace Settings {
|
|||
setupContent(controller);
|
||||
}
|
||||
|
||||
void Ayu::SetupAyuGramSettings(not_null<Ui::VerticalLayout *> container) {
|
||||
void Ayu::SetupGhostEssentials(not_null<Ui::VerticalLayout *> container) {
|
||||
auto settings = &AyuSettings::getInstance();
|
||||
|
||||
AddSkip(container);
|
||||
AddSubsectionTitle(container, tr::ayu_GhostEssentialsHeader());
|
||||
|
||||
AddButton(
|
||||
|
@ -52,7 +52,7 @@ namespace Settings {
|
|||
return (enabled != settings->sendReadPackets);
|
||||
}) | rpl::start_with_next([=](bool enabled) {
|
||||
settings->set_sendReadPackets(enabled);
|
||||
Local::writeSettings();
|
||||
AyuSettings::save();
|
||||
}, container->lifetime());
|
||||
|
||||
AddButton(
|
||||
|
@ -66,7 +66,7 @@ namespace Settings {
|
|||
return (enabled != settings->sendOnlinePackets);
|
||||
}) | rpl::start_with_next([=](bool enabled) {
|
||||
settings->set_sendOnlinePackets(enabled);
|
||||
Local::writeSettings();
|
||||
AyuSettings::save();
|
||||
}, container->lifetime());
|
||||
|
||||
AddButton(
|
||||
|
@ -80,7 +80,7 @@ namespace Settings {
|
|||
return (enabled != settings->sendUploadProgress);
|
||||
}) | rpl::start_with_next([=](bool enabled) {
|
||||
settings->set_sendUploadProgress(enabled);
|
||||
Local::writeSettings();
|
||||
AyuSettings::save();
|
||||
}, container->lifetime());
|
||||
|
||||
AddButton(
|
||||
|
@ -94,7 +94,7 @@ namespace Settings {
|
|||
return (enabled != settings->sendOfflinePacketAfterOnline);
|
||||
}) | rpl::start_with_next([=](bool enabled) {
|
||||
settings->set_sendOfflinePacketAfterOnline(enabled);
|
||||
Local::writeSettings();
|
||||
AyuSettings::save();
|
||||
}, container->lifetime());
|
||||
|
||||
AddButton(
|
||||
|
@ -108,11 +108,12 @@ namespace Settings {
|
|||
return (enabled != settings->useScheduledMessages);
|
||||
}) | rpl::start_with_next([=](bool enabled) {
|
||||
settings->set_useScheduledMessages(enabled);
|
||||
Local::writeSettings();
|
||||
AyuSettings::save();
|
||||
}, container->lifetime());
|
||||
}
|
||||
|
||||
AddDivider(container);
|
||||
AddSkip(container);
|
||||
void Ayu::SetupSpyEssentials(not_null<Ui::VerticalLayout *> container) {
|
||||
auto settings = &AyuSettings::getInstance();
|
||||
|
||||
AddSubsectionTitle(container, tr::ayu_SpyEssentialsHeader());
|
||||
|
||||
|
@ -127,7 +128,7 @@ namespace Settings {
|
|||
return (enabled != settings->keepDeletedMessages);
|
||||
}) | rpl::start_with_next([=](bool enabled) {
|
||||
settings->set_keepDeletedMessages(enabled);
|
||||
Local::writeSettings();
|
||||
AyuSettings::save();
|
||||
}, container->lifetime());
|
||||
|
||||
AddButton(
|
||||
|
@ -141,18 +142,17 @@ namespace Settings {
|
|||
return (enabled != settings->keepMessagesHistory);
|
||||
}) | rpl::start_with_next([=](bool enabled) {
|
||||
settings->set_keepMessagesHistory(enabled);
|
||||
Local::writeSettings();
|
||||
AyuSettings::save();
|
||||
}, container->lifetime());
|
||||
}
|
||||
|
||||
AddDivider(container);
|
||||
AddSkip(container);
|
||||
|
||||
void Ayu::SetupCustomization(not_null<Ui::VerticalLayout *> container, not_null<Window::SessionController *> controller) {
|
||||
AddSubsectionTitle(container, tr::ayu_CustomizationHeader());
|
||||
|
||||
auto btn = AddButtonWithLabel(
|
||||
container,
|
||||
tr::ayu_DeletedMarkText(),
|
||||
AyuSettings::get_deletedMarkReactive().value(),
|
||||
AyuSettings::get_deletedMarkReactive(),
|
||||
st::settingsButtonNoIcon
|
||||
);
|
||||
btn->addClickHandler([=]() {
|
||||
|
@ -163,7 +163,7 @@ namespace Settings {
|
|||
auto btn2 = AddButtonWithLabel(
|
||||
container,
|
||||
rpl::single(QString("Edited mark")),
|
||||
AyuSettings::get_editedMarkReactive().value(),
|
||||
AyuSettings::get_editedMarkReactive(),
|
||||
st::settingsButtonNoIcon
|
||||
);
|
||||
btn2->addClickHandler([=]() {
|
||||
|
@ -171,13 +171,64 @@ namespace Settings {
|
|||
Ui::show(std::move(box));
|
||||
});
|
||||
|
||||
SetupShowPeerId(container, controller);
|
||||
}
|
||||
|
||||
void Ayu::SetupShowPeerId(not_null<Ui::VerticalLayout *> container, not_null<Window::SessionController *> controller) {
|
||||
auto settings = &AyuSettings::getInstance();
|
||||
|
||||
const auto options = std::vector{
|
||||
QString(tr::ayu_SettingsShowID_Hide(tr::now)),
|
||||
QString("Telegram API"),
|
||||
QString("Bot API")
|
||||
};
|
||||
|
||||
auto currentVal = AyuSettings::get_showPeerId() | rpl::map([=] (int val) {
|
||||
return options[val];
|
||||
});
|
||||
|
||||
const auto button = AddButtonWithLabel(
|
||||
container,
|
||||
tr::ayu_SettingsShowID(),
|
||||
currentVal,
|
||||
st::settingsButtonNoIcon);
|
||||
button->addClickHandler([=] {
|
||||
controller->show(Box([=](not_null<Ui::GenericBox*> box) {
|
||||
const auto save = [=](int index) {
|
||||
settings->set_showPeerId(index);
|
||||
AyuSettings::save();
|
||||
};
|
||||
SingleChoiceBox(box, {
|
||||
.title = tr::ayu_SettingsShowID(),
|
||||
.options = options,
|
||||
.initialSelection = settings->showPeerId,
|
||||
.callback = save,
|
||||
});
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
void Ayu::SetupAyuGramSettings(not_null<Ui::VerticalLayout *> container, not_null<Window::SessionController *> controller) {
|
||||
AddSkip(container);
|
||||
SetupGhostEssentials(container);
|
||||
|
||||
AddDivider(container);
|
||||
|
||||
AddSkip(container);
|
||||
SetupSpyEssentials(container);
|
||||
|
||||
AddDivider(container);
|
||||
|
||||
AddSkip(container);
|
||||
SetupCustomization(container, controller);
|
||||
|
||||
AddDividerText(container, tr::ayu_SettingsWatermark());
|
||||
}
|
||||
|
||||
void Ayu::setupContent(not_null<Window::SessionController *> controller) {
|
||||
const auto content = Ui::CreateChild<Ui::VerticalLayout>(this);
|
||||
|
||||
SetupAyuGramSettings(content);
|
||||
SetupAyuGramSettings(content, controller);
|
||||
|
||||
Ui::ResizeFitChild(this, content);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,12 @@ namespace Settings {
|
|||
[[nodiscard]] rpl::producer<QString> title() override;
|
||||
|
||||
private:
|
||||
void SetupAyuGramSettings(not_null<Ui::VerticalLayout *> container);
|
||||
void SetupGhostEssentials(not_null<Ui::VerticalLayout *> container);
|
||||
void SetupSpyEssentials(not_null<Ui::VerticalLayout *> container);
|
||||
void SetupCustomization(not_null<Ui::VerticalLayout *> container, not_null<Window::SessionController *> controller);
|
||||
void SetupShowPeerId(not_null<Ui::VerticalLayout *> container, not_null<Window::SessionController *> controller);
|
||||
|
||||
void SetupAyuGramSettings(not_null<Ui::VerticalLayout *> container, not_null<Window::SessionController *> null);
|
||||
void setupContent(not_null<Window::SessionController *> controller);
|
||||
};
|
||||
|
||||
|
|
33
Telegram/SourceFiles/ayu/utils/ayu_profile_values.cpp
Normal file
33
Telegram/SourceFiles/ayu/utils/ayu_profile_values.cpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
#include "ui/text/text_utilities.h"
|
||||
#include "ayu/ayu_settings.h"
|
||||
#include "ayu_profile_values.h"
|
||||
#include "data/data_peer.h"
|
||||
|
||||
|
||||
constexpr auto kMaxChannelId = -1000000000000;
|
||||
|
||||
|
||||
QString IDString(not_null<PeerData*> peer) {
|
||||
auto resultId = QString::number(peerIsUser(peer->id)
|
||||
? peerToUser(peer->id).bare
|
||||
: peerIsChat(peer->id)
|
||||
? peerToChat(peer->id).bare
|
||||
: peerIsChannel(peer->id)
|
||||
? peerToChannel(peer->id).bare
|
||||
: peer->id.value);
|
||||
|
||||
auto const settings = &AyuSettings::getInstance();
|
||||
if (settings->showPeerId == 2) {
|
||||
if (peer->isChannel()) {
|
||||
resultId = QString::number(peerToChannel(peer->id).bare - kMaxChannelId).prepend("-");
|
||||
} else if (peer->isChat()) {
|
||||
resultId = resultId.prepend("-");
|
||||
}
|
||||
}
|
||||
|
||||
return resultId;
|
||||
}
|
||||
|
||||
rpl::producer<TextWithEntities> IDValue(not_null<PeerData*> peer) {
|
||||
return rpl::single(IDString(peer)) | Ui::Text::ToWithEntities();
|
||||
}
|
5
Telegram/SourceFiles/ayu/utils/ayu_profile_values.h
Normal file
5
Telegram/SourceFiles/ayu/utils/ayu_profile_values.h
Normal file
|
@ -0,0 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
|
||||
QString IDString(not_null<PeerData*> peer);
|
||||
rpl::producer<TextWithEntities> IDValue(not_null<PeerData*> peer);
|
|
@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
*/
|
||||
#include "info/profile/info_profile_actions.h"
|
||||
|
||||
#include "ayu/ayu_settings.h"
|
||||
#include "data/data_peer_values.h"
|
||||
#include "data/data_session.h"
|
||||
#include "data/data_folder.h"
|
||||
|
@ -15,6 +16,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "data/data_changes.h"
|
||||
#include "data/data_user.h"
|
||||
#include "data/notify/data_notify_settings.h"
|
||||
#include "ui/text/text_entity.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "ui/wrap/padding_wrap.h"
|
||||
#include "ui/wrap/slide_wrap.h"
|
||||
|
@ -67,6 +69,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include <QtGui/QGuiApplication>
|
||||
#include <QtGui/QClipboard>
|
||||
|
||||
#include "ayu/utils/ayu_profile_values.h"
|
||||
|
||||
namespace Info {
|
||||
namespace Profile {
|
||||
namespace {
|
||||
|
@ -283,6 +287,8 @@ bool SetClickContext(
|
|||
}
|
||||
|
||||
object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
||||
auto settings = &AyuSettings::getInstance();
|
||||
|
||||
auto result = object_ptr<Ui::VerticalLayout>(_wrap);
|
||||
auto tracker = Ui::MultiSlideTracker();
|
||||
|
||||
|
@ -475,6 +481,29 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
|||
});
|
||||
}
|
||||
|
||||
if (settings->showPeerId != 0) {
|
||||
auto idDrawableText = IDValue(
|
||||
user
|
||||
) | rpl::map([](TextWithEntities &&text) {
|
||||
return Ui::Text::Code(text.text);
|
||||
});
|
||||
auto idInfo = addInfoOneLine(
|
||||
rpl::single(QString("ID")),
|
||||
std::move(idDrawableText),
|
||||
tr::ayu_ContextCopyID(tr::now)
|
||||
);
|
||||
|
||||
idInfo.text->setClickHandlerFilter([=](auto &&...) {
|
||||
const auto idText = IDString(user);
|
||||
if (!idText.isEmpty()) {
|
||||
QGuiApplication::clipboard()->setText(idText);
|
||||
const auto msg = tr::ayu_IDCopiedToast(tr::now);
|
||||
controller->showToast(msg);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
AddMainButton(
|
||||
result,
|
||||
tr::lng_info_add_as_contact(),
|
||||
|
@ -535,6 +564,29 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
|||
if (!_topic) {
|
||||
addTranslateToMenu(about.text, AboutValue(_peer));
|
||||
}
|
||||
|
||||
if (settings->showPeerId != 0) {
|
||||
auto idDrawableText = IDValue(
|
||||
_peer
|
||||
) | rpl::map([](TextWithEntities &&text) {
|
||||
return Ui::Text::Code(text.text);
|
||||
});
|
||||
auto idInfo = addInfoOneLine(
|
||||
rpl::single(QString("ID")),
|
||||
std::move(idDrawableText),
|
||||
tr::ayu_ContextCopyID(tr::now)
|
||||
);
|
||||
|
||||
idInfo.text->setClickHandlerFilter([=, peer = _peer](auto &&...) {
|
||||
const auto idText = IDString(peer);
|
||||
if (!idText.isEmpty()) {
|
||||
QGuiApplication::clipboard()->setText(idText);
|
||||
const auto msg = tr::ayu_IDCopiedToast(tr::now);
|
||||
controller->showToast(msg);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
if (!_peer->isSelf()) {
|
||||
// No notifications toggle for Self => no separator.
|
||||
|
|
|
@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
*/
|
||||
#include "window/window_main_menu.h"
|
||||
|
||||
#include "lang_auto.h"
|
||||
#include "window/themes/window_theme.h"
|
||||
#include "window/window_peer_menu.h"
|
||||
#include "window/window_session_controller.h"
|
||||
|
@ -845,9 +846,9 @@ void MainMenu::setupMenu() {
|
|||
|
||||
const auto settings = &AyuSettings::getInstance();
|
||||
_ghostModeToggle = addAction(
|
||||
rpl::single(QString("Ghost Mode")),
|
||||
tr::ayu_DrawerGhostModeToggle(),
|
||||
{ &st::menuIconFake, kIconPurple }
|
||||
)->toggleOn(AyuSettings::get_ghostModeEnabled().value());
|
||||
)->toggleOn(AyuSettings::get_ghostModeEnabled());
|
||||
|
||||
_ghostModeToggle->toggledChanges(
|
||||
) | rpl::start_with_next([=](bool ghostMode) {
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
{
|
||||
"SettingsWatermark": "AyuGram developed and maintained by Radolyn Labs"
|
||||
"SettingsWatermark": "AyuGram developed and maintained by Radolyn Labs",
|
||||
"SettingsShowID": "Show peer ID",
|
||||
"SettingsShowID_Hide": "Hide",
|
||||
"ContextCopyID": "Copy ID",
|
||||
"IDCopiedToast": "ID copied to clipboard.",
|
||||
"DrawerGhostModeToggle": "Ghost Mode"
|
||||
}
|
Loading…
Add table
Reference in a new issue