From 6cc5bc3e008c48ca1ecfea640d84f11ccbfe7775 Mon Sep 17 00:00:00 2001 From: Christophe Chapuis Date: Sat, 17 Oct 2015 21:09:29 +0200 Subject: [PATCH 06/18] WebEngineSettings: Add a "standardFontFamily" property to be able to setup Prelude Signed-off-by: Christophe Chapuis --- src/webengine/api/qquickwebenginesettings.cpp | 13 +++++++++++++ src/webengine/api/qquickwebenginesettings_p.h | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/src/webengine/api/qquickwebenginesettings.cpp b/src/webengine/api/qquickwebenginesettings.cpp index bcc5326..c0f1227 100644 --- a/src/webengine/api/qquickwebenginesettings.cpp +++ b/src/webengine/api/qquickwebenginesettings.cpp @@ -391,6 +391,11 @@ QString QQuickWebEngineSettings::luneOSIdentifier() const return d_ptr->luneOSIdentifier(); } +QString QQuickWebEngineSettings::standardFontFamily() const +{ + return d_ptr->fontFamily(WebEngineSettings::StandardFont);; +} + void QQuickWebEngineSettings::setAutoLoadImages(bool on) { bool wasOn = d_ptr->testAttribute(WebEngineSettings::AutoLoadImages); @@ -603,6 +608,14 @@ void QQuickWebEngineSettings::setLuneOSIdentifier(QString identifier) Q_EMIT luneOSIdentifierChanged(); } +void QQuickWebEngineSettings::setStandardFontFamily(QString fontFamily) +{ + const QString oldStandardFontFamily = d_ptr->fontFamily(WebEngineSettings::StandardFont); + d_ptr->setFontFamily(WebEngineSettings::StandardFont, fontFamily); + if (oldStandardFontFamily.compare(fontFamily)) + Q_EMIT standardFontFamilyChanged(); +} + void QQuickWebEngineSettings::setParentSettings(QQuickWebEngineSettings *parentSettings) { d_ptr->setParentSettings(parentSettings->d_ptr.data()); diff --git a/src/webengine/api/qquickwebenginesettings_p.h b/src/webengine/api/qquickwebenginesettings_p.h index 4893b34..8b5cf49 100644 --- a/src/webengine/api/qquickwebenginesettings_p.h +++ b/src/webengine/api/qquickwebenginesettings_p.h @@ -89,6 +89,7 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineSettings : public QObject { Q_PROPERTY(bool palmServiceBridgeEnabled READ palmServiceBridgeEnabled WRITE setPalmServiceBridgeEnabled NOTIFY palmServiceBridgeEnabledChanged) Q_PROPERTY(bool luneOSPrivileged READ luneOSPrivileged WRITE setLuneOSPrivileged NOTIFY luneOSPrivilegedChanged) Q_PROPERTY(QString luneOSIdentifier READ luneOSIdentifier WRITE setLuneOSIdentifier NOTIFY luneOSIdentifierChanged) + Q_PROPERTY(QString standardFontFamily READ standardFontFamily WRITE setStandardFontFamily NOTIFY standardFontFamilyChanged) public: ~QQuickWebEngineSettings(); @@ -119,6 +120,7 @@ public: bool palmServiceBridgeEnabled() const; bool luneOSPrivileged() const; QString luneOSIdentifier() const; + QString standardFontFamily() const; void setAutoLoadImages(bool on); void setJavascriptEnabled(bool on); @@ -146,6 +148,7 @@ public: void setPalmServiceBridgeEnabled(bool on); void setLuneOSPrivileged(bool on); void setLuneOSIdentifier(QString identifier); + void setStandardFontFamily(QString fontFamily); signals: void autoLoadImagesChanged(); @@ -174,6 +177,7 @@ signals: void palmServiceBridgeEnabledChanged(); void luneOSPrivilegedChanged(); void luneOSIdentifierChanged(); + void standardFontFamilyChanged(); private: explicit QQuickWebEngineSettings(QQuickWebEngineSettings *parentSettings = 0); -- 2.7.4