Use UserSettings where possible
This commit is contained in:
parent
eae09f8f14
commit
46e15218d4
@ -20,6 +20,7 @@
|
|||||||
#include "Cache.h"
|
#include "Cache.h"
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "MatrixClient.h"
|
#include "MatrixClient.h"
|
||||||
|
#include "UserSettingsPage.h"
|
||||||
|
|
||||||
using TimelineEvent = mtx::events::collections::TimelineEvents;
|
using TimelineEvent = mtx::events::collections::TimelineEvents;
|
||||||
|
|
||||||
@ -65,14 +66,11 @@ utils::replaceEmoji(const QString &body)
|
|||||||
|
|
||||||
QVector<uint> utf32_string = body.toUcs4();
|
QVector<uint> utf32_string = body.toUcs4();
|
||||||
|
|
||||||
QSettings settings;
|
|
||||||
QString userFontFamily = settings.value("user/emoji_font_family", "emoji").toString();
|
|
||||||
|
|
||||||
bool insideFontBlock = false;
|
bool insideFontBlock = false;
|
||||||
for (auto &code : utf32_string) {
|
for (auto &code : utf32_string) {
|
||||||
if (utils::codepointIsEmoji(code)) {
|
if (utils::codepointIsEmoji(code)) {
|
||||||
if (!insideFontBlock) {
|
if (!insideFontBlock) {
|
||||||
fmtBody += QString("<font face=\"" + userFontFamily + "\">");
|
fmtBody += QString("<font face=\"" + UserSettings::instance()->font() + "\">");
|
||||||
insideFontBlock = true;
|
insideFontBlock = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -505,13 +503,7 @@ utils::getQuoteBody(const RelatedInfo &related)
|
|||||||
QString
|
QString
|
||||||
utils::linkColor()
|
utils::linkColor()
|
||||||
{
|
{
|
||||||
QSettings settings;
|
const auto theme = UserSettings::instance()->theme();
|
||||||
// Default to system theme if QT_QPA_PLATFORMTHEME var is set.
|
|
||||||
QString defaultTheme =
|
|
||||||
QProcessEnvironment::systemEnvironment().value("QT_QPA_PLATFORMTHEME", "").isEmpty()
|
|
||||||
? "light"
|
|
||||||
: "system";
|
|
||||||
const auto theme = settings.value("user/theme", defaultTheme).toString();
|
|
||||||
|
|
||||||
if (theme == "light") {
|
if (theme == "light") {
|
||||||
return "#0077b5";
|
return "#0077b5";
|
||||||
|
Loading…
Reference in New Issue
Block a user