|
|
@ -94,6 +94,7 @@ UserSettings::load(std::optional<QString> profile) |
|
|
|
settings.value(QStringLiteral("user/decrypt_notifications"), true).toBool(); |
|
|
|
settings.value(QStringLiteral("user/decrypt_notifications"), true).toBool(); |
|
|
|
spaceNotifications_ = settings.value(QStringLiteral("user/space_notifications"), true).toBool(); |
|
|
|
spaceNotifications_ = settings.value(QStringLiteral("user/space_notifications"), true).toBool(); |
|
|
|
fancyEffects_ = settings.value(QStringLiteral("user/fancy_effects"), true).toBool(); |
|
|
|
fancyEffects_ = settings.value(QStringLiteral("user/fancy_effects"), true).toBool(); |
|
|
|
|
|
|
|
reducedMotion_ = settings.value(QStringLiteral("user/reduced_motion"), false).toBool(); |
|
|
|
privacyScreen_ = settings.value(QStringLiteral("user/privacy_screen"), false).toBool(); |
|
|
|
privacyScreen_ = settings.value(QStringLiteral("user/privacy_screen"), false).toBool(); |
|
|
|
privacyScreenTimeout_ = |
|
|
|
privacyScreenTimeout_ = |
|
|
|
settings.value(QStringLiteral("user/privacy_screen_timeout"), 0).toInt(); |
|
|
|
settings.value(QStringLiteral("user/privacy_screen_timeout"), 0).toInt(); |
|
|
@ -471,6 +472,22 @@ UserSettings::setFancyEffects(bool state) |
|
|
|
save(); |
|
|
|
save(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
|
|
|
UserSettings::setReducedMotion(bool state) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (state == reducedMotion_) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
reducedMotion_ = state; |
|
|
|
|
|
|
|
emit reducedMotionChanged(state); |
|
|
|
|
|
|
|
save(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Also toggle other motion related settings
|
|
|
|
|
|
|
|
if (reducedMotion_) { |
|
|
|
|
|
|
|
setFancyEffects(false); |
|
|
|
|
|
|
|
setAnimateImagesOnHover(true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
void |
|
|
|
UserSettings::setPrivacyScreen(bool state) |
|
|
|
UserSettings::setPrivacyScreen(bool state) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -835,6 +852,7 @@ UserSettings::save() |
|
|
|
settings.setValue(QStringLiteral("decrypt_notificatons"), decryptNotifications_); |
|
|
|
settings.setValue(QStringLiteral("decrypt_notificatons"), decryptNotifications_); |
|
|
|
settings.setValue(QStringLiteral("space_notifications"), spaceNotifications_); |
|
|
|
settings.setValue(QStringLiteral("space_notifications"), spaceNotifications_); |
|
|
|
settings.setValue(QStringLiteral("fancy_effects"), fancyEffects_); |
|
|
|
settings.setValue(QStringLiteral("fancy_effects"), fancyEffects_); |
|
|
|
|
|
|
|
settings.setValue(QStringLiteral("reduced_motion"), reducedMotion_); |
|
|
|
settings.setValue(QStringLiteral("privacy_screen"), privacyScreen_); |
|
|
|
settings.setValue(QStringLiteral("privacy_screen"), privacyScreen_); |
|
|
|
settings.setValue(QStringLiteral("privacy_screen_timeout"), privacyScreenTimeout_); |
|
|
|
settings.setValue(QStringLiteral("privacy_screen_timeout"), privacyScreenTimeout_); |
|
|
|
settings.setValue(QStringLiteral("mobile_mode"), mobileMode_); |
|
|
|
settings.setValue(QStringLiteral("mobile_mode"), mobileMode_); |
|
|
@ -991,6 +1009,8 @@ UserSettingsModel::data(const QModelIndex &index, int role) const |
|
|
|
return tr("Show message counts for communities and tags"); |
|
|
|
return tr("Show message counts for communities and tags"); |
|
|
|
case FancyEffects: |
|
|
|
case FancyEffects: |
|
|
|
return tr("Display fancy effects such as confetti"); |
|
|
|
return tr("Display fancy effects such as confetti"); |
|
|
|
|
|
|
|
case ReducedMotion: |
|
|
|
|
|
|
|
return tr("Reduce or disable animations"); |
|
|
|
case PrivacyScreen: |
|
|
|
case PrivacyScreen: |
|
|
|
return tr("Privacy Screen"); |
|
|
|
return tr("Privacy Screen"); |
|
|
|
case PrivacyScreenTimeout: |
|
|
|
case PrivacyScreenTimeout: |
|
|
@ -1039,6 +1059,8 @@ UserSettingsModel::data(const QModelIndex &index, int role) const |
|
|
|
return tr("Platform"); |
|
|
|
return tr("Platform"); |
|
|
|
case GeneralSection: |
|
|
|
case GeneralSection: |
|
|
|
return tr("GENERAL"); |
|
|
|
return tr("GENERAL"); |
|
|
|
|
|
|
|
case AccessibilitySection: |
|
|
|
|
|
|
|
return tr("ACCESSIBILITY"); |
|
|
|
case TimelineSection: |
|
|
|
case TimelineSection: |
|
|
|
return tr("TIMELINE"); |
|
|
|
return tr("TIMELINE"); |
|
|
|
case SidebarSection: |
|
|
|
case SidebarSection: |
|
|
@ -1129,6 +1151,8 @@ UserSettingsModel::data(const QModelIndex &index, int role) const |
|
|
|
return i->spaceNotifications(); |
|
|
|
return i->spaceNotifications(); |
|
|
|
case FancyEffects: |
|
|
|
case FancyEffects: |
|
|
|
return i->fancyEffects(); |
|
|
|
return i->fancyEffects(); |
|
|
|
|
|
|
|
case ReducedMotion: |
|
|
|
|
|
|
|
return i->reducedMotion(); |
|
|
|
case PrivacyScreen: |
|
|
|
case PrivacyScreen: |
|
|
|
return i->privacyScreen(); |
|
|
|
return i->privacyScreen(); |
|
|
|
case PrivacyScreenTimeout: |
|
|
|
case PrivacyScreenTimeout: |
|
|
@ -1296,6 +1320,9 @@ UserSettingsModel::data(const QModelIndex &index, int role) const |
|
|
|
case FancyEffects: |
|
|
|
case FancyEffects: |
|
|
|
return tr("Some messages can be sent with fancy effects. For example, messages sent " |
|
|
|
return tr("Some messages can be sent with fancy effects. For example, messages sent " |
|
|
|
"with '/confetti' will show confetti on screen."); |
|
|
|
"with '/confetti' will show confetti on screen."); |
|
|
|
|
|
|
|
case ReducedMotion: |
|
|
|
|
|
|
|
return tr("Nheko uses animations in several places to make stuff pretty. This allows " |
|
|
|
|
|
|
|
"you to turn those off if they make you feel unwell."); |
|
|
|
case PrivacyScreen: |
|
|
|
case PrivacyScreen: |
|
|
|
return tr("When the window loses focus, the timeline will\nbe blurred."); |
|
|
|
return tr("When the window loses focus, the timeline will\nbe blurred."); |
|
|
|
case MobileMode: |
|
|
|
case MobileMode: |
|
|
@ -1326,6 +1353,7 @@ UserSettingsModel::data(const QModelIndex &index, int role) const |
|
|
|
case Version: |
|
|
|
case Version: |
|
|
|
case Platform: |
|
|
|
case Platform: |
|
|
|
case GeneralSection: |
|
|
|
case GeneralSection: |
|
|
|
|
|
|
|
case AccessibilitySection: |
|
|
|
case TimelineSection: |
|
|
|
case TimelineSection: |
|
|
|
case SidebarSection: |
|
|
|
case SidebarSection: |
|
|
|
case TraySection: |
|
|
|
case TraySection: |
|
|
@ -1409,6 +1437,7 @@ UserSettingsModel::data(const QModelIndex &index, int role) const |
|
|
|
case ExposeDBusApi: |
|
|
|
case ExposeDBusApi: |
|
|
|
case SpaceNotifications: |
|
|
|
case SpaceNotifications: |
|
|
|
case FancyEffects: |
|
|
|
case FancyEffects: |
|
|
|
|
|
|
|
case ReducedMotion: |
|
|
|
return Toggle; |
|
|
|
return Toggle; |
|
|
|
case Profile: |
|
|
|
case Profile: |
|
|
|
case UserId: |
|
|
|
case UserId: |
|
|
@ -1420,6 +1449,7 @@ UserSettingsModel::data(const QModelIndex &index, int role) const |
|
|
|
case Platform: |
|
|
|
case Platform: |
|
|
|
return ReadOnlyText; |
|
|
|
return ReadOnlyText; |
|
|
|
case GeneralSection: |
|
|
|
case GeneralSection: |
|
|
|
|
|
|
|
case AccessibilitySection: |
|
|
|
case TimelineSection: |
|
|
|
case TimelineSection: |
|
|
|
case SidebarSection: |
|
|
|
case SidebarSection: |
|
|
|
case TraySection: |
|
|
|
case TraySection: |
|
|
@ -1744,6 +1774,13 @@ UserSettingsModel::setData(const QModelIndex &index, const QVariant &value, int |
|
|
|
} else |
|
|
|
} else |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
case ReducedMotion: { |
|
|
|
|
|
|
|
if (value.userType() == QMetaType::Bool) { |
|
|
|
|
|
|
|
i->setReducedMotion(value.toBool()); |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} else |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
case PrivacyScreen: { |
|
|
|
case PrivacyScreen: { |
|
|
|
if (value.userType() == QMetaType::Bool) { |
|
|
|
if (value.userType() == QMetaType::Bool) { |
|
|
|
i->setPrivacyScreen(value.toBool()); |
|
|
|
i->setPrivacyScreen(value.toBool()); |
|
|
@ -2068,6 +2105,9 @@ UserSettingsModel::UserSettingsModel(QObject *p) |
|
|
|
connect(s.get(), &UserSettings::fancyEffectsChanged, this, [this]() { |
|
|
|
connect(s.get(), &UserSettings::fancyEffectsChanged, this, [this]() { |
|
|
|
emit dataChanged(index(FancyEffects), index(FancyEffects), {Value}); |
|
|
|
emit dataChanged(index(FancyEffects), index(FancyEffects), {Value}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
connect(s.get(), &UserSettings::reducedMotionChanged, this, [this]() { |
|
|
|
|
|
|
|
emit dataChanged(index(ReducedMotion), index(ReducedMotion), {Value}); |
|
|
|
|
|
|
|
}); |
|
|
|
connect(s.get(), &UserSettings::trayChanged, this, [this]() { |
|
|
|
connect(s.get(), &UserSettings::trayChanged, this, [this]() { |
|
|
|
emit dataChanged(index(Tray), index(Tray), {Value}); |
|
|
|
emit dataChanged(index(Tray), index(Tray), {Value}); |
|
|
|
emit dataChanged(index(StartInTray), index(StartInTray), {Enabled}); |
|
|
|
emit dataChanged(index(StartInTray), index(StartInTray), {Enabled}); |
|
|
|