diff --git a/session/application.cpp b/session/application.cpp
index ed65bc8..c1a3bb9 100644
--- a/session/application.cpp
+++ b/session/application.cpp
@@ -196,13 +196,20 @@ void Application::initXResource()
int fontDpi = 96 * scaleFactor;
QString cursorTheme = settings.value("CursorTheme", "default").toString();
int cursorSize = settings.value("CursorSize", 24).toInt() * scaleFactor;
+ int xftAntialias = settings.value("XftAntialias", 1).toBool();
+ QString xftHintStyle = settings.value("XftHintStyle", "hintslight").toString();
const QString datas = QString("Xft.dpi: %1\n"
"Xcursor.theme: %2\n"
- "Xcursor.size: %3")
+ "Xcursor.size: %3\n"
+ "Xft.antialias: %4\n"
+ "Xft.hintstyle: %5\n"
+ "Xft.rgba: rgb")
.arg(fontDpi)
.arg(cursorTheme)
- .arg(cursorSize);
+ .arg(cursorSize)
+ .arg(xftAntialias)
+ .arg(xftHintStyle);
QProcess p;
p.start(QStringLiteral("xrdb"), {QStringLiteral("-quiet"), QStringLiteral("-merge"), QStringLiteral("-nocpp")});
diff --git a/settings-daemon/theme/org.cutefish.Theme.xml b/settings-daemon/theme/org.cutefish.Theme.xml
index 05ab62f..76a3099 100644
--- a/settings-daemon/theme/org.cutefish.Theme.xml
+++ b/settings-daemon/theme/org.cutefish.Theme.xml
@@ -38,6 +38,8 @@
+
+
diff --git a/settings-daemon/theme/thememanager.cpp b/settings-daemon/theme/thememanager.cpp
index 6ad931b..76b84da 100644
--- a/settings-daemon/theme/thememanager.cpp
+++ b/settings-daemon/theme/thememanager.cpp
@@ -131,7 +131,7 @@ void ThemeManager::setCursorTheme(const QString &theme)
if (m_cursorTheme != theme) {
m_cursorTheme = theme;
m_settings->setValue("CursorTheme", m_cursorTheme);
- applyXResource();
+ applyXResources();
applyCursor();
emit cursorThemeChanged();
}
@@ -147,7 +147,7 @@ void ThemeManager::setCursorSize(int size)
if (m_cursorSize != size) {
m_cursorSize = size;
m_settings->setValue("CursorSize", m_cursorSize);
- applyXResource();
+ applyXResources();
applyCursor();
emit cursorSizeChanged();
}
@@ -196,7 +196,7 @@ void ThemeManager::setDevicePixelRatio(qreal ratio)
m_settings->setValue(s_devicePixelRatio, ratio);
m_settings->setValue("forceFontDPI", fontDpi);
m_settings->sync();
- applyXResource();
+ applyXResources();
}
QString ThemeManager::wallpaper()
@@ -258,17 +258,26 @@ void ThemeManager::initGtkConfig()
settings.sync();
}
-void ThemeManager::applyXResource()
+void ThemeManager::applyXResources()
{
+ m_settings->sync();
+
qreal scaleFactor = this->devicePixelRatio();
int fontDpi = 96 * scaleFactor;
+ int xftAntialias = m_settings->value("XftAntialias", 1).toBool();
+ QString xftHintStyle = m_settings->value("XftHintStyle").toString();
+
const QString datas = QString("Xft.dpi: %1\n"
"Xcursor.theme: %2\n"
- "Xcursor.size: %3")
+ "Xcursor.size: %3\n"
+ "Xft.antialias: %4\n"
+ "Xft.hintstyle: %5")
.arg(fontDpi)
.arg(m_cursorTheme)
- .arg(m_cursorSize * scaleFactor);
+ .arg(m_cursorSize * scaleFactor)
+ .arg(xftAntialias)
+ .arg(xftHintStyle);
QProcess p;
p.start(QStringLiteral("xrdb"), {QStringLiteral("-quiet"), QStringLiteral("-merge"), QStringLiteral("-nocpp")});
diff --git a/settings-daemon/theme/thememanager.h b/settings-daemon/theme/thememanager.h
index 9a6a99e..cd236bd 100644
--- a/settings-daemon/theme/thememanager.h
+++ b/settings-daemon/theme/thememanager.h
@@ -79,7 +79,7 @@ public:
void setCursorSize(int size);
void initGtkConfig();
- void applyXResource();
+ void applyXResources();
void applyCursor();
signals: