mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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,
|
localPremium,
|
||||||
copyUsernameAsLink,
|
copyUsernameAsLink,
|
||||||
appIcon,
|
appIcon,
|
||||||
|
simpleQuotesAndReplies,
|
||||||
deletedMark,
|
deletedMark,
|
||||||
editedMark,
|
editedMark,
|
||||||
recentStickersCount,
|
recentStickersCount,
|
||||||
|
|
|
@ -805,22 +805,6 @@ void Ayu::SetupCustomization(not_null<Ui::VerticalLayout *> container,
|
||||||
AyuSettings::save();
|
AyuSettings::save();
|
||||||
}, container->lifetime());
|
}, 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(
|
AddButton(
|
||||||
container,
|
container,
|
||||||
tr::ayu_SettingsShowMessageSeconds(),
|
tr::ayu_SettingsShowMessageSeconds(),
|
||||||
|
|
|
@ -102,23 +102,25 @@ void Tray::rebuildMenu() {
|
||||||
|
|
||||||
auto settings = &AyuSettings::getInstance();
|
auto settings = &AyuSettings::getInstance();
|
||||||
|
|
||||||
auto turnGhostModeText = _textUpdates.events(
|
if (settings->showGhostToggleInTray) {
|
||||||
) | rpl::map([=]
|
auto turnGhostModeText = _textUpdates.events(
|
||||||
{
|
) | rpl::map([=]
|
||||||
bool ghostModeEnabled = AyuSettings::get_ghostModeEnabled();
|
{
|
||||||
|
bool ghostModeEnabled = AyuSettings::get_ghostModeEnabled();
|
||||||
|
|
||||||
return ghostModeEnabled
|
return ghostModeEnabled
|
||||||
? tr::ayu_DisableGhostModeTray(tr::now)
|
? tr::ayu_DisableGhostModeTray(tr::now)
|
||||||
: tr::ayu_EnableGhostModeTray(tr::now);
|
: tr::ayu_EnableGhostModeTray(tr::now);
|
||||||
});
|
});
|
||||||
_tray.addAction(std::move(turnGhostModeText), [=]
|
_tray.addAction(std::move(turnGhostModeText), [=]
|
||||||
{
|
{
|
||||||
bool ghostMode = AyuSettings::get_ghostModeEnabled();
|
bool ghostMode = AyuSettings::get_ghostModeEnabled();
|
||||||
|
|
||||||
settings->set_ghostModeEnabled(!ghostMode);
|
settings->set_ghostModeEnabled(!ghostMode);
|
||||||
|
|
||||||
AyuSettings::save();
|
AyuSettings::save();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (settings->showStreamerToggleInTray) {
|
if (settings->showStreamerToggleInTray) {
|
||||||
auto turnStreamerModeText = _textUpdates.events(
|
auto turnStreamerModeText = _textUpdates.events(
|
||||||
|
|
Loading…
Add table
Reference in a new issue