mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
fix: tray and serialization
This commit is contained in:
parent
ae3dfacdf9
commit
95f18f2120
3 changed files with 17 additions and 30 deletions
|
@ -221,6 +221,7 @@ NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(
|
|||
localPremium,
|
||||
copyUsernameAsLink,
|
||||
appIcon,
|
||||
simpleQuotesAndReplies,
|
||||
deletedMark,
|
||||
editedMark,
|
||||
recentStickersCount,
|
||||
|
|
|
@ -805,22 +805,6 @@ void Ayu::SetupCustomization(not_null<Ui::VerticalLayout *> container,
|
|||
AyuSettings::save();
|
||||
}, container->lifetime());
|
||||
|
||||
AddButton(
|
||||
container,
|
||||
tr::ayu_ShowGhostToggleInDrawer(),
|
||||
st::settingsButtonNoIcon
|
||||
)->toggleOn(
|
||||
rpl::single(settings->showGhostToggleInDrawer)
|
||||
)->toggledValue(
|
||||
) | rpl::filter([=](bool enabled)
|
||||
{
|
||||
return (enabled != settings->showGhostToggleInDrawer);
|
||||
}) | start_with_next([=](bool enabled)
|
||||
{
|
||||
settings->set_showGhostToggleInDrawer(enabled);
|
||||
AyuSettings::save();
|
||||
}, container->lifetime());
|
||||
|
||||
AddButton(
|
||||
container,
|
||||
tr::ayu_SettingsShowMessageSeconds(),
|
||||
|
|
|
@ -102,23 +102,25 @@ void Tray::rebuildMenu() {
|
|||
|
||||
auto settings = &AyuSettings::getInstance();
|
||||
|
||||
auto turnGhostModeText = _textUpdates.events(
|
||||
) | rpl::map([=]
|
||||
{
|
||||
bool ghostModeEnabled = AyuSettings::get_ghostModeEnabled();
|
||||
if (settings->showGhostToggleInTray) {
|
||||
auto turnGhostModeText = _textUpdates.events(
|
||||
) | rpl::map([=]
|
||||
{
|
||||
bool ghostModeEnabled = AyuSettings::get_ghostModeEnabled();
|
||||
|
||||
return ghostModeEnabled
|
||||
? tr::ayu_DisableGhostModeTray(tr::now)
|
||||
: tr::ayu_EnableGhostModeTray(tr::now);
|
||||
});
|
||||
_tray.addAction(std::move(turnGhostModeText), [=]
|
||||
{
|
||||
bool ghostMode = AyuSettings::get_ghostModeEnabled();
|
||||
return ghostModeEnabled
|
||||
? tr::ayu_DisableGhostModeTray(tr::now)
|
||||
: tr::ayu_EnableGhostModeTray(tr::now);
|
||||
});
|
||||
_tray.addAction(std::move(turnGhostModeText), [=]
|
||||
{
|
||||
bool ghostMode = AyuSettings::get_ghostModeEnabled();
|
||||
|
||||
settings->set_ghostModeEnabled(!ghostMode);
|
||||
settings->set_ghostModeEnabled(!ghostMode);
|
||||
|
||||
AyuSettings::save();
|
||||
});
|
||||
AyuSettings::save();
|
||||
});
|
||||
}
|
||||
|
||||
if (settings->showStreamerToggleInTray) {
|
||||
auto turnStreamerModeText = _textUpdates.events(
|
||||
|
|
Loading…
Add table
Reference in a new issue