|
|
|
@ -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).toString(); |
|
|
|
|
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.startGroup("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_); |
|
|
|
|
|
|
|
|
|
auto typingLayout = new QHBoxLayout; |
|
|
|
|
typingLayout->setContentsMargins(0, OptionMargin, 0, OptionMargin); |
|
|
|
|
auto typingLabel = new QLabel(tr("Typing notifications"), this); |
|
|
|
@ -369,6 +383,8 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge |
|
|
|
|
mainLayout_->addWidget(new HorizontalLine(this)); |
|
|
|
|
mainLayout_->addLayout(groupViewLayout); |
|
|
|
|
mainLayout_->addWidget(new HorizontalLine(this)); |
|
|
|
|
mainLayout_->addWidget(avatarViewLayout); |
|
|
|
|
mainLayout_->addWidget(new HorizontalLine(this)); |
|
|
|
|
mainLayout_->addLayout(typingLayout); |
|
|
|
|
mainLayout_->addLayout(receiptsLayout); |
|
|
|
|
mainLayout_->addLayout(desktopLayout); |
|
|
|
@ -448,6 +464,10 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge |
|
|
|
|
settings_->setGroupView(!isDisabled); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
connect(groupViewToggle_, &Toggle::toggled, this, [this](bool isDisabled) { |
|
|
|
|
settings_->setRounded(!isDisabled); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
connect(typingNotifications_, &Toggle::toggled, this, [this](bool isDisabled) { |
|
|
|
|
settings_->setTypingNotifications(!isDisabled); |
|
|
|
|
}); |
|
|
|
|