summaryrefslogtreecommitdiffstats
path: root/src/plugins/platformthemes/gtk2
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2014-08-12 16:59:18 +0200
committerAllan Sandfeld Jensen <allan.jensen@digia.com>2014-08-17 03:46:30 +0200
commit2a33bfcfd174d503e2f98c66d8de0a68783015da (patch)
tree7dac11f04abd5fda0a614d049a8d4481d07a7fec /src/plugins/platformthemes/gtk2
parent3e0a6c1b3698226e8f64d6e737d83a725fc970d9 (diff)
GTK2 theme should use GTK configured font variant
This patch makes the GTK2 theme read the font configuration and use that as the default system font. Task-number: QTBUG-39643 Change-Id: Ieacf8968e54f34c6d44669350d349c9a96ed6cc5 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/plugins/platformthemes/gtk2')
-rw-r--r--src/plugins/platformthemes/gtk2/qgtk2theme.cpp8
-rw-r--r--src/plugins/platformthemes/gtk2/qgtk2theme.h3
2 files changed, 10 insertions, 1 deletions
diff --git a/src/plugins/platformthemes/gtk2/qgtk2theme.cpp b/src/plugins/platformthemes/gtk2/qgtk2theme.cpp
index 812f4bc000..4df3a304e1 100644
--- a/src/plugins/platformthemes/gtk2/qgtk2theme.cpp
+++ b/src/plugins/platformthemes/gtk2/qgtk2theme.cpp
@@ -85,6 +85,14 @@ QVariant QGtk2Theme::themeHint(QPlatformTheme::ThemeHint hint) const
}
}
+QString QGtk2Theme::gtkFontName() const
+{
+ QString cfgFontName = gtkSetting("gtk-font-name");
+ if (!cfgFontName.isEmpty())
+ return cfgFontName;
+ return QGnomeTheme::gtkFontName();
+}
+
bool QGtk2Theme::usePlatformNativeDialog(DialogType type) const
{
switch (type) {
diff --git a/src/plugins/platformthemes/gtk2/qgtk2theme.h b/src/plugins/platformthemes/gtk2/qgtk2theme.h
index a0bd34ed9f..c74e58e648 100644
--- a/src/plugins/platformthemes/gtk2/qgtk2theme.h
+++ b/src/plugins/platformthemes/gtk2/qgtk2theme.h
@@ -51,7 +51,8 @@ class QGtk2Theme : public QGnomeTheme
public:
QGtk2Theme();
- QVariant themeHint(ThemeHint hint) const;
+ virtual QVariant themeHint(ThemeHint hint) const Q_DECL_OVERRIDE;
+ virtual QString gtkFontName() const Q_DECL_OVERRIDE;
bool usePlatformNativeDialog(DialogType type) const;
QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const;