|
|
|
@ -53,6 +53,7 @@ UserSettings::load() |
|
|
|
|
isReadReceiptsEnabled_ = settings.value("user/read_receipts", true).toBool(); |
|
|
|
|
theme_ = settings.value("user/theme", defaultTheme_).toString(); |
|
|
|
|
font_ = settings.value("user/font_family", "default").toString(); |
|
|
|
|
avatarCircles_ = settings.value("user/avatar/circles", true).toBool(); |
|
|
|
|
emojiFont_ = settings.value("user/emoji_font_family", "default").toString(); |
|
|
|
|
baseFontSize_ = settings.value("user/font_size", QFont().pointSizeF()).toDouble(); |
|
|
|
|
|
|
|
|
@ -118,6 +119,10 @@ UserSettings::save() |
|
|
|
|
settings.setValue("start_in_tray", isStartInTrayEnabled_); |
|
|
|
|
settings.endGroup(); |
|
|
|
|
|
|
|
|
|
settings.beginGroup("avatar"); |
|
|
|
|
settings.setValue("circles", avatarCircles_); |
|
|
|
|
settings.endGroup(); |
|
|
|
|
|
|
|
|
|
settings.setValue("font_size", baseFontSize_); |
|
|
|
|
settings.setValue("typing_notifications", isTypingNotificationsEnabled_); |
|
|
|
|
settings.setValue("read_receipts", isReadReceiptsEnabled_); |
|
|
|
@ -192,6 +197,15 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge |
|
|
|
|
groupViewLayout->addWidget(groupViewLabel); |
|
|
|
|
groupViewLayout->addWidget(groupViewToggle_, 0, Qt::AlignRight); |
|
|
|
|
|
|
|
|
|
auto avatarViewLayout = new QHBoxLayout; |
|
|
|
|
avatarViewLayout->setContentsMargins(0, OptionMargin, 0, OptionMargin); |
|
|
|
|
auto avatarViewLabel = new QLabel(tr("Circular Avatars"), this); |
|
|
|
|
avatarViewLabel->setFont(font); |
|
|
|
|
avatarCircles_ = new Toggle(this); |
|
|
|
|
|
|
|
|
|
avatarViewLayout->addWidget(avatarViewLabel); |
|
|
|
|
avatarViewLayout->addWidget(avatarCircles_, 0, Qt::AlignRight); |
|
|
|
|
|
|
|
|
|
auto typingLayout = new QHBoxLayout; |
|
|
|
|
typingLayout->setContentsMargins(0, OptionMargin, 0, OptionMargin); |
|
|
|
|
auto typingLabel = new QLabel(tr("Typing notifications"), this); |
|
|
|
@ -368,6 +382,7 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge |
|
|
|
|
mainLayout_->addLayout(startInTrayOptionLayout_); |
|
|
|
|
mainLayout_->addWidget(new HorizontalLine(this)); |
|
|
|
|
mainLayout_->addLayout(groupViewLayout); |
|
|
|
|
mainLayout_->addLayout(avatarViewLayout); |
|
|
|
|
mainLayout_->addWidget(new HorizontalLine(this)); |
|
|
|
|
mainLayout_->addLayout(typingLayout); |
|
|
|
|
mainLayout_->addLayout(receiptsLayout); |
|
|
|
@ -448,6 +463,10 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge |
|
|
|
|
settings_->setGroupView(!isDisabled); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
connect(avatarCircles_, &Toggle::toggled, this, [this](bool isDisabled) { |
|
|
|
|
settings_->setAvatarCircles(!isDisabled); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
connect(typingNotifications_, &Toggle::toggled, this, [this](bool isDisabled) { |
|
|
|
|
settings_->setTypingNotifications(!isDisabled); |
|
|
|
|
}); |
|
|
|
|